|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (10 bit)
|
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. |
|
|
|
|
|
#2 |
|
Member (5 bit)
Join Date: Nov 2000
Posts: 25
|
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... |
|
|
|
|
|
#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.... |
|
|
|
|
|
#4 |
|
Member (10 bit)
|
Thank you.
Thank you very much. That is exactly what I was looking for.
|
|
|
|
|
|
#5 |
|
Member (10 bit)
|
To step through it writing one line at a time into a select box I would do what?
PHP Code:
|
|
|
|
|
|
#6 |
|
Member (10 bit)
|
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. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|