PDA

View Full Version : Brain not working 2day, asp problem


man_im_bored
06-21-03, 02:58
I need to create an array :

i=20
dim theArray(i)

I haven't actually done this one before where you say that the number of array value's you want is equal to a varable rather than a constant, so......

how do i make "i" a constant? (Because it comes up with the error saying 'needs to be a constant integer')

I tried int(i) before declaring the array, but it didn't work:(

goldfish
06-21-03, 08:52
http://www.w3schools.com/asp/showasp.asp?filename=demo_array

const i = 20
should work i would have thought...

man_im_bored
06-21-03, 22:58
I'm pretty sure I tried that....

but maybe i didn't. I'll go check (the pc i use for internet is different from my programming one).

anyone else? If I don't reply, it didn't work.

man_im_bored
06-22-03, 20:17
No, it didn't work, but I found something anyway...

http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=63

thanks anyway

Kodo
06-22-03, 21:56
Dim array()
i=20
Redim array(i)

man_im_bored
06-23-03, 01:17
I was going to try that....but i forgot. Yeah, thats a lot simpliar thanks....