ecnarongi
04-14-2004, 04:58 PM
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% Dim i,j
Redim inventory(3,3)
for i = 0 to 3
inventory(i,i) = i + 20
next
Session("cart") = inventory
inventory = Session("cart")
with response
for j = 0 to 3
.write inventory(j,j) & "<br>"
next
end with
%>
<% response.end %>
what I am trying to do here is just make an array and assign it to a session variable. Then retrieve that information from the session variable and output all of its values to the screen, as an example of how a cart would work.
If my approach is wrong please tell me, and show me the right path to the answer. All help is appreciated, thanks.
----- update ------
the above code doesn't work b/c I reuse the inventory variable without Redimming it. If I were to use another variable instead of inventory to output to the screen it would work. Thanks to all who viewed with intensions to help.
<% Dim i,j
Redim inventory(3,3)
for i = 0 to 3
inventory(i,i) = i + 20
next
Session("cart") = inventory
inventory = Session("cart")
with response
for j = 0 to 3
.write inventory(j,j) & "<br>"
next
end with
%>
<% response.end %>
what I am trying to do here is just make an array and assign it to a session variable. Then retrieve that information from the session variable and output all of its values to the screen, as an example of how a cart would work.
If my approach is wrong please tell me, and show me the right path to the answer. All help is appreciated, thanks.
----- update ------
the above code doesn't work b/c I reuse the inventory variable without Redimming it. If I were to use another variable instead of inventory to output to the screen it would work. Thanks to all who viewed with intensions to help.