I have the strangest problem:
I have a listbox on one page, the results of which are put into a session variable which is an array like this:
dim intCount
'dynamic array
dim arraySkills()
'for each selected element in listbox
for intCount=0 to Request.Form.Item("lstSkills"
.count - 1
'dynamically increase array size but preserve contents
redim preserve arraySkills(intCount)
'populate array
arraySkills(intCount) = Request.Form.Item("lstSkills"
(intCount + 1)
next
'put array in session variable
session.Contents("SearchSkills"
= arraySkills
I have used this method on many other pages with much success.
On the second page, I fish out the values like this:
dim intCount
dim skills
for intCount = 0 to ubound(session.Contents("SearchSkills"
)
skills = skills & session.Contents("SearchSkills"
(intCount) & ","
next
I have also used this before with success.
However, on this fine occassion, I'm getting
subscript out of range: 'ubound'
error.
Can anyone please tell me what I am doing wrong?
Also, how do I leave off the comma delimiter from the last run of the loop?
Any help is appreciated!!
I have a listbox on one page, the results of which are put into a session variable which is an array like this:
dim intCount
'dynamic array
dim arraySkills()
'for each selected element in listbox
for intCount=0 to Request.Form.Item("lstSkills"
'dynamically increase array size but preserve contents
redim preserve arraySkills(intCount)
'populate array
arraySkills(intCount) = Request.Form.Item("lstSkills"
next
'put array in session variable
session.Contents("SearchSkills"
I have used this method on many other pages with much success.
On the second page, I fish out the values like this:
dim intCount
dim skills
for intCount = 0 to ubound(session.Contents("SearchSkills"
skills = skills & session.Contents("SearchSkills"
next
I have also used this before with success.
However, on this fine occassion, I'm getting
subscript out of range: 'ubound'
error.
Can anyone please tell me what I am doing wrong?
Also, how do I leave off the comma delimiter from the last run of the loop?
Any help is appreciated!!