Array To Store Data in
Array To Store Data in
<title>arraysredim.asp</title>
</head><body bgcolor="#ffffff">
<%
' this code
dim a_array(100)
%>
</body></html>
assigning an array size with a variable produces an error unless the redim command
is used.
<html><head>
<title>arraysredimcorrect.asp</title>
</head><body bgcolor="#ffffff">
<%
dim my_array()
x=100
redim preserve my_array(x)
my_array(20)="hi!"
my_array(40)="how are you"
lowcount=lbound(my_array)
highcount=ubound(my_array)
response.write "lowcount=" & lowcount & ";highcount=" & highcount & "<p>"
for counter=lowcount to highcount
response.write counter & " "
response.write my_array(counter) & "<br>
next
%>
</body></html>