Determine of var is String or Array

T

!TG

How do I determine if a variable is an array or a string?
I want to send a variable to a function, but sometimes it will be an
array and sometimes a string.
Each must be treated differently I assume.
I want to write string to DB field and Array in as comma separated
string to DB Field
 
T

!TG

Ray said:
Would you happen to know now how I can put the values into a string now?
My code is:
ThisArray = Array("Hi","There","How","Are","You")
dim x
For Each x in ThisArray
sLIN = cstr(ThisArray(x))
Response.Write(sLIN)
Next

That returned Type mismatch: 'Hi'

Trying to write ThisArray(x) directlt also gives the same error
 
R

Roland Hall

in message
: response.write join(ThisArray," ")

If delimiter is omitted, space is used: Response.Write join(ThisArray)

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,150
Messages
2,570,853
Members
47,394
Latest member
Olekdev

Latest Threads

Top