|
Arrays to
store data Part #1 by Charles Carroll
Here would be a code sample
without arrays:
filename=/learn/test/arraysnot.asp
<html><head>
<title>arraysnot.asp</title>
</head><body bgcolor="#FFFFFF">
<%
dim x,y,z
x=7
y=20
z=x+y
response.write z
%>
</body></html>
Here is the same example with arrays
filename=/learn/test/arrays.asp
<html><head>
<title>arrays.asp</title>
</head><body bgcolor="#FFFFFF">
<%
dim allstuff(3)
allstuff(0)=7
allstuff(1)=20
allstuff(2)=allstuff(0)+allstuff(1)
response.write allstuff(2)
%>
</body></html>
http://www.learnasp.com/freebook/asp/subdates.aspx
has a good example of arrays in a practical context.
|