Link to home
Create AccountLog in
Avatar of APD Toronto
APD TorontoFlag for Canada

asked on

Working with Session Arrays

Hello Experts,

Can anyone post for me sample code on how read and write arrays of an unknown number of items?

I used to know this in VB6, I;'m also reading that in classic asp you cannot read/.write the session irectly.

i remember that everytime you write a ned item you Redim to UBound + 1?

and, everytime you red you do for i = UBound - 1?

Pklease refresh my memory.,  getting old.
Avatar of Brook Braswell
Brook Braswell
Flag of United States of America image

To read your array...
For i = lBound(array) to UBound(array)
   debug.print Array(i)
Next

to Write or Add to an array...
iLast = Ubound(Array) + 1
ReDim Preserve Array(iLast)
Array(iLast) = "Your Value"
Avatar of APD Toronto

ASKER

Thanks.

Does UBound give the exact number of items, or do you 8need to add or subtract one?

can you show me 2-dimension array?

can i use session arrays directly?
ASKER CERTIFIED SOLUTION
Avatar of Brook Braswell
Brook Braswell
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account