473,322 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Determine of var is String or Array

!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
Jul 29 '05 #1
5 2209
IsArray maybe? What language are you writing in?

http://msdn.microsoft.com/library/en...fctIsArray.asp

TypeName?
http://msdn.microsoft.com/library/en...ctTypeName.asp
Download WSH documentation:
http://www.microsoft.com/downloads/d...6-1C4099D7BBB9

Ray at work


"!TG" <27********@southwestfunding.com> wrote in message
news:e0**************@TK2MSFTNGP10.phx.gbl...
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

Jul 29 '05 #2
!TG
Ray Costanzo [MVP] wrote:
IsArray maybe? What language are you writing in?

http://msdn.microsoft.com/library/en...fctIsArray.asp

TypeName?
http://msdn.microsoft.com/library/en...ctTypeName.asp
Download WSH documentation:
http://www.microsoft.com/downloads/d...6-1C4099D7BBB9

Ray at work


"!TG" <27********@southwestfunding.com> wrote in message
news:e0**************@TK2MSFTNGP10.phx.gbl...
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


That worked, Thanks!
VBScript was the language
Jul 29 '05 #3
!TG
Ray Costanzo [MVP] wrote:
IsArray maybe? What language are you writing in?

http://msdn.microsoft.com/library/en...fctIsArray.asp

TypeName?
http://msdn.microsoft.com/library/en...ctTypeName.asp
Download WSH documentation:
http://www.microsoft.com/downloads/d...6-1C4099D7BBB9

Ray at work


"!TG" <27********@southwestfunding.com> wrote in message
news:e0**************@TK2MSFTNGP10.phx.gbl...
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


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
Jul 29 '05 #4
response.write join(ThisArray," ")

Tim
--
Tim Williams
Palo Alto, CA
"!TG" <27********@southwestfunding.com> wrote in message
news:ex*************@TK2MSFTNGP10.phx.gbl...

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

Jul 29 '05 #5
"Tim Williams" wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
: 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

Jul 30 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jason | last post by:
I have a number of arrays that are populated with database values. I need to determine which array has the highest ubound out of all the arrays. The array size will always change based on the...
16
by: Jm | last post by:
Hi All Is it possible to determine who is logged onto a machine from inside a service using code in vb.net ? I have found some code that seems to work under vb6, but doesnt under .NET ? Any help...
4
by: ad | last post by:
I have a string array. How can I determine if a string in it?
2
by: Ole | last post by:
By converting a string in a textbox to a byte array I'll need the byte size of the string - how to determine that? Thanks Ole
4
by: Frank Rizzo | last post by:
I read a string out of a database, which contains serialized objects. How can I determine the encoding of the string? Thanks
2
by: Jeff | last post by:
ASP.NET 2.0 Below are some code from my webproject. What I'm trying to do is create a MembershipUserCollection which holds users of the role "member" this line: string role =...
6
by: =?Utf-8?B?bWFnZWxsYW4=?= | last post by:
Hi, I'd appreciae any advice on how to do this in VB 2005. I have a simple array;e..g, a list of States, e.g., CA, WA, ID, AL, and etc... I like to determine how many unqiue "States" are...
9
by: | last post by:
I am interested in scanning web pages for content of interest, and then auto-classifying that content. I have tables of metadata that I can use for the classification, e.g. : "John P. Jones" "Jane...
9
by: paktsardines | last post by:
Dear all, As of yesterday I have this function: char ** lines = read_file("filename.txt"); Now, I want to print the contents of lines. A first attempt: int i=0;
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.