Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 07-30-2001, 11:52 AM   #1
Member (10 bit)
 
Join Date: May 1999
Location: Orlando, FL
Posts: 975
Send a message via ICQ to artsapimp
ASP Node Array

I know someone here (probably UncaDanno) answered this before for me but I lost it.

I know there is a way to seperate information by a common symbol but can't find an example of how to do it. I am looking for the syntax to seperate a long list at a comma.

(ie.
List - Art, Alan, Steve, John, Mary, Jennifer
I would like to create an array which is made dynamically
Name(0) = Art
Name(1) = Alan
Name(2) = Steve
Name(3) = John
Name(4) = Mary
Name(5) = Jennifer

Thanks for any help.
artsapimp is offline   Reply With Quote
Old 07-30-2001, 11:34 PM   #2
Member (5 bit)
 
Join Date: Nov 2000
Posts: 25
Cool

Not sure what language you want but here is VBScript.
I didn't test this. Just a quick post.

Dim MyString, MyArray, Msg
MyString = "Art, Alan, Steve, John, Mary, Jennifer"
MyArray = Split(MyString, ",",-1,1)

'MyArray(0) contains Art
'MyArray(1) contains Alan
etc...
beemer is offline   Reply With Quote
Old 07-31-2001, 06:46 AM   #3
Member (9 bit)
 
Join Date: Dec 1999
Location: Midland, NC, USA
Posts: 292
Good call, beemer. That'll do it.

In the case of JScript, it'd look something like this:

var MyString;
MyString = ; //set this to the comma-delimited string of names
var MyArray = MyString.split(","); // the delimiter is all you need.


Same as with beemer's code, MyArray[0] will contain Art, MyArray[1] will
contain Alan, etc....
UncaDanno is offline   Reply With Quote
Old 07-31-2001, 09:21 AM   #4
Member (10 bit)
 
Join Date: May 1999
Location: Orlando, FL
Posts: 975
Send a message via ICQ to artsapimp
Thank you.

Thank you very much. That is exactly what I was looking for.
artsapimp is offline   Reply With Quote
Old 07-31-2001, 10:03 AM   #5
Member (10 bit)
 
Join Date: May 1999
Location: Orlando, FL
Posts: 975
Send a message via ICQ to artsapimp
To step through it writing one line at a time into a select box I would do what?

PHP Code:
For 0 To ... What goes here
I know it's not PHP but it makes it look nice with this BB.
artsapimp is offline   Reply With Quote
Old 07-31-2001, 10:24 AM   #6
Member (10 bit)
 
Join Date: May 1999
Location: Orlando, FL
Posts: 975
Send a message via ICQ to artsapimp
I'm sorry. I don't know why I was so confused. I'm using a For Each loop now and it works fine.

Thanks again for your help.
artsapimp is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:09 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2