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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create array in application variabel

Status
Not open for further replies.

johz

Programmer
Sep 4, 2000
1
SE
Hello.

I want to use a application variabel(for exampel application("test") ) lika a array. Does it work ?
How ?

Thanks
 
Try this. It shows that you can use either application or session variables...

default.asp -
Code:
<%
 Dim arrApp, arrSes
 arrApp = Array(&quot;App 0&quot;, &quot;App 1&quot;, &quot;App 2&quot;)
 arrSes = Array(&quot;Ses 0&quot;, &quot;Ses 1&quot;, &quot;Ses 2&quot;, &quot;Ses 3&quot;, &quot;Ses 4&quot;)
 Application(&quot;arrApp&quot;)= arrApp
 Session(&quot;arrSes&quot;) = arrSes
%>
<html>
<body>
<a href=&quot;showarray.asp&quot;>Click Here</a>
</body>
</html>

showarray.asp -
Code:
<html>
<body>
<%
 Dim arrApp, arrSes
 arrApp = Application(&quot;arrApp&quot;)
 arrSes = Session(&quot;arrSes&quot;)
 dim numApp, numSes
 numApp = ubound(arrApp)
 numSes = ubound(arrSes)

 for i = 0 to numApp
  response.write &quot;Application Array &quot; & i & &quot; = &quot; & arrApp(i) & &quot;<br>&quot;
 next
 
 response.write &quot;<br>&quot;
 
 for i = 0 to numSes
  response.write &quot;Session Array &quot; & i & &quot; = &quot; & arrSes(i) & &quot;<br>&quot;
 next
%>
</body>
</html>

Hope this helps,
Rob [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top