[thelist] VBScript - declaring dynamically named vars in a Fo rloop

Pringle, Ron RPringle at aurora-il.org
Thu Mar 3 16:20:09 CST 2005


> Ok, backing up here. How to I declare an array with a value 
> that is passed
> as a variable from a form?
> 
> Assuming I have a text input form where a number is entered, 
> and that form
> field is named "howMany". Lets say I've input "2" in that 
> field, so using
> the below code:
> 
> howMany = CInt(request.form("howMany"))
> 
> howMany should have an integer of 2 as its value, correct?
> 
> Now I want to dimension an array with the size of "howMany". 
> I've tried
> writing it out as:
> 
> Dim sEventDate(howMany)
> 
> That just throws an error saying "Expected integer constant".

Ok, I kind of get it now. I've done the following:


Dim seventDate()
ReDim seventDate(CInt(request.form("howMany")))

Now I just need to figure out how to fill the array with the contents of the
form fields.

TY for the help all, I'm getting my head around it slowly.

Ron


More information about the thelist mailing list