Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Session Array would change


Message #1 by "Ken Lee" <tormented1_au@h...> on Fri, 04 Oct 2002 17:25:20 +1000
Hi All, 
  I have a problem with a session variable two dimenional array I've created for a very simple ordering form.
  I'm just trying add 1 to the qty of the session variable but it just wouldn't change...ie. 
  Session("OrderCart")(i, 1) = Session("OrderCart")(i, 1) + 1
  I've tried Session("OrderCart")(i, 1) = 10 but it still doesn't do anything. Is there a way I can change the session value without
creating a whole array, update the new array then replacing the whole session variable with the new array?
Thanks in advance!!
KenChat with friends online, try MSN Messenger: Click Here
Message #2 by "phil griffiths" <pgtips@m...> on Fri, 4 Oct 2002 10:55:11
You have to get it out of the session, change it, then put it back in, 
something like:
vArray = Session("OrderCart")
...
vArray(i, 1) = vArray(i, 1) + 1
...
Session("OrderCart") = vArray

That's not too bad, is it?

hth
Phil
>-----------------------------------------------
> Hi All, 
  I have a problem with a session variable two dimenional array I've 
created for a very simple ordering form.
  I'm just trying add 1 to the qty of the session variable but it just 
wouldn't change...ie. 
  Session("OrderCart")(i, 1) = Session("OrderCart")(i, 1) + 1
  I've tried Session("OrderCart")(i, 1) = 10 but it still doesn't do 
anything. Is there a way I can change the session value without creating a 
whole array, update the new array then replacing the whole session 
variable with the new array?
Thanks in advance!!
Ken

  Return to Index