Working with arrays
An array is a variable that can contain more than one value at the same time.
Every value has a different place in the array that's desided by an index.
These values can, just like with normal variables, be changed as the code is executed.
An array is declared in the same way as an ordinary variable, but how many values
should fit in the array is given between parentheses.
array1.asp
<%
Option Explicit
Dim MyArray(3)
MyArray(0) = "Pete"
MyArray(1) = "John"
MyArray(2) = "Mark"
%>
<HTML>
<BODY>
<%
Response.Write "Names:<br>"
Response.Write MyArray(0) & " <br>"
Response.Write MyArray(1) & " <br>"
Response.Write MyArray(2) & " <br>"
%>
</BODY>
</HTML>
|