I had this wierd idea. Everywhere I read, it says that the only way to store an array in a Session is like this:
Dim x(400)
x(3) = 3
x(4) = 5
Session("x" = x
'later
x = Session("x"
Response.Write x(3)
Response.Write x(4)
Right? But I've made this little snippet of code:
function GetSessionArray(aname, idx)
GetSessionArray = Session(aname & idx)
end function
sub SetSessionArray(aname, idx, val)
Session(aname & idx) = val
end sub
So I can go like this:
SetSessionArray("x", 3, 3)
SetSessionArray("x", 4, 6)
'later
for i = 1 to 400
Response.Write GetSessionArray("x", i)
next
What do you think? [sig][/sig]
Dim x(400)
x(3) = 3
x(4) = 5
Session("x" = x
'later
x = Session("x"
Response.Write x(3)
Response.Write x(4)
Right? But I've made this little snippet of code:
function GetSessionArray(aname, idx)
GetSessionArray = Session(aname & idx)
end function
sub SetSessionArray(aname, idx, val)
Session(aname & idx) = val
end sub
So I can go like this:
SetSessionArray("x", 3, 3)
SetSessionArray("x", 4, 6)
'later
for i = 1 to 400
Response.Write GetSessionArray("x", i)
next
What do you think? [sig][/sig]