Link to home
Start Free TrialLog in
Avatar of Tom Knowlton
Tom KnowltonFlag for United States of America

asked on

Arrays in VBScript

How do I declare and use an array in VBScript?

My goal is to use an array to accumulate a bunch of SQL statements.....then loop through them and run Conn.Execute(array[x]) for each one.
Avatar of samdlg
samdlg

Dim newArray()
Avatar of Tom Knowlton

ASKER

And then how would I add elements to the array?
here's the rest:

for i = 0 to UBound(newArray)
  newArray(i) = "newValue" & i
next


ASKER CERTIFIED SOLUTION
Avatar of samdlg
samdlg

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I want to add elements to the array inside different Subroutine and Function calls.....then when the user clicks "submit"....loop through the array.
The array would have to be global to the various ASP pages that use it.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I will probably just DIM the array to handle say 20 elements.

This should be more than I need.
so...did I answer your question?  if so, please reward me the points, I need to ask a few others.

thanks.
samdig:  I am evaluating all the answers I have gotten.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
alorentz (and the other Experts).


I want to change the way I am doing things.....and have JavaScript control the game board at runtime, and record the information behind each game piece:


https://www.experts-exchange.com/questions/20936405/Array-of-Structs.html
Sorry, that's why I'm in the ASP area...I don't support Javascript unless I have too.
Fair enough.  :)