![]() |
|
|
+ Search |
![]()
|
Sep 17th, 2003 11:45
Adam Baruch, unknown unknown, lungor
Dim arrMyArray(2)
arrMyArray(0) = "Hello"
arrMyArray(1) = " there!"
Session("arrMyArray") = arrMyArray
------------------------------------
Now this might look as an easy way to use (display) arrays stored as
session, but in fact this will NOT work:
If IsArray(Session("arrMyArray")) Then
Response.Write Session("arrMyArray")(0)
Response.Write Session("arrMyArray")(1)
End If
Output:
Hello there!
You must again use a arrMyArray and then write from it.
---------------------
A piece of advice: I noticed that you cannot change an array thatīs
stored in a session variable directly, like this:
Session("arrMyArray")(0) = "Happy"
Session("arrMyArray")(1) = " birthday!"
The new values to the array will not be stored in the session array for
some strange reason.
Instead you need to assign the session-array to a local variable and
then change it, like this:
Dim tmpArray
tmpArray = Session("arrMyArray")
tmpArray(0) = "Happy"
tmpArray(1) = " birthday!"
Session("arrMyArray") = tmpArray
© 1999-2004 Synop Pty Ltd