|
An array is a contiguous space of memory allocated for storing some data. An array is declared with the keyword DIM and then the array name and then the size of the array in parentheses. Here is an example.
<%
DIM strWdays(6)
DIM i
strWdays (0) = "Sunday"
strWdays (1) = "Monday"
strWdays (2) = "Tuesday"
strWdays (3) = "Wednesday"
strWdays (4) = "Thursday"
strWdays (5) = "Firday"
strWdays (6) = "Saturday"
for i = 0 to 6
response.write(strWdays (i) & "<br>")
next
%>
Array () function:
The Array () function can be used to initialize values to an array. Below is the example.
<%
DIM strCities
strCities = Array ("New York", "Los Angeles", "Miami")
%>
|