To save an array in a session variable you have to create the array as a
local variable first then put it into a session variable. To access it later
you have to put it into a local variable again.
(note: from memory, may need some adjustments)
dim aIn(), aOut
dim i, key, iIndex
redim aIn( request.querystring.count ) 'make array big enough to hold all
params
i = 0
for each key in request.QueryString
if left(key,6) = "cboRun" then
iIndex = cint(mid (key,7))
response.Write(iIndex & "<br>")
aIn(i) = iIndex ' could use aIn(iIndex)=iIndex if that is what is
needed
i = i + 1
end if
next
redim preserve aIn( i-1 ) 'adjust upper bound to match count of desired
params
Session("iRunNo") = aIn
aOut = Session("iRunNo")
for i = 0 to ubound(aOut)
response.Write(aOut(i) & "<br>")
Next
--
--Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Neil Jarman" <ne**@tNOiSPAMvPLEASEy.co.uk> wrote in message
news:cs*******************@news.demon.co.uk...
Hi,
I need to create an array with a session variable.
According to thebook I'm using, the following should work, but if fails:
for each key in request.QueryString
if left(key,6) = "cboRun" then
iIndex = cint(mid (key,7))
response.Write(iIndex & "<br>")
session.Contents("iRunNo")(iIndex)=iIndex
end if
next
it is the (iIndex) part which fails. If I remove this, then I can create a
single session variable
Any suggestions where I'm going wrong.
Many thansk
NEIL