Search Search

#1 worldwide
FREE Coding Lessons

since 1996
   THE BEST WAY to learn ASP & Asp.net!
Advertise Here!
click for details
Credits Host:
DiscountASP.net
Server Admin:
The "Team"
Contact Info.
Charles M. Carroll

my Blog
[prev. Lesson]  Strings: JOIN Function
     [next Lesson]  Arrays: Variable Size

Arrays to store data Part #1 by Charles Carroll

Here would be a code sample without arrays:
   filename=/learn/test/arraysnot.asp

<Test Script Below>


<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

<Test Script Below>


<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.

Send Us a Holiday Gift!. Charles celebrates Christmas, Jewish holidays, Kwanza, Chinese New Year, Japanese Holidays, Secretary Day, High Muslim Holy Days, Pagan & Wicca holidays, and many more! - send a gift any HOLIDAY. 2004 gift gallery & 2005 gift gallery