Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with modifying session variable

Status
Not open for further replies.

bobmmp

Programmer
Apr 22, 2002
43
US
Hi. I have an application that I am working on where I am storying information passed from a form to a session veriable.

Session("books") = Session("books") & intRefNumber & ":" & strBookTitle & ":" & strBookSubject & ":" & strBookRecommend & "|"

When several items are added to the session the session looks like this

1:Book Name 1:Book Subject 1:no|1:Book Name 2:Book Subject 2:yes|

I then use the split(variable, "|") into a 2d array.

I want to be able to delete items from the session without having to do it in the array and rebuild the session.

when using Session("books") = removeItem(intReferenceNumber, Session("books") I get a type mismatch error.

Am I doing something wrong or is this not allowed.

Thanks for any help!

Bob
 
I am presuming that the removeItem is a function that you have written. CAn you post the code for that funcion. Mighty :)
 
Also you might consider subkeys if you're stuck with session variables.
e.g.
Session("books") = Session("books") & intRefNumber & ":" & strBookTitle & ":" & strBookSubject & ":" & strBookRecommend & "|"
becomes
Session("BookTitle")(intRefNumber)=strBookTitle
Session("BookSubject")(intRefNumber)=strBookSubject
Session("BookRecommend")(intRefNumber)=strBookRecommend codestorm
Fire bad. Tree pretty. - Buffy
Hey, I'm operating on a limited mental budget here.
<insert witticism here>
 
*chuckle* the preceding quote was from Buffy the Vampire Slayer. codestorm
Fire bad. Tree pretty. - Buffy
Hey, I'm operating on a limited mental budget here.
<insert witticism here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top