PDA

View Full Version : working with arrays



ifym
01-29-2003, 05:51 AM
ok heres the situation, i want to use inputbox to say "enter number"; the user enters it, hits enter, then it asks him again, untill the user hits done or cancel or whatever. NOW the probme is, i want to enter all of these numbers the user enters into an array to use in the script, cant figure it out. Probably a very simple question but i dont know that much about vbscript yet.thanks

Jama
01-29-2003, 08:48 AM
Do While 0 = 0
z = inputbox("Please enter a number","Number To Array")
If z = "" Then
Exit Do
Else
s = s & z & ","
End If
Loop


myArray = split(s, ",")


For i = 0 To Ubound(myArray) - 1
wscript.echo myArray(i)
Next

<a target="_blank" href=http://www.winguides.com/forums/showflat.php?Cat=&Board=brdScripting&Number=61245&page=&view=&sb=&vc=1>This thread explains the functions used</a>

Jama

ifym
01-29-2003, 10:02 AM
wow that looks pretty good im gona try it thanks