ASP Tutorial array Arrays function instance
ASP array functions are used to create a static one-dimensional array. You cannot declare a dynamic array using array functionality.
Note that the first element in an array is always marked, such as zero,
MyArray (0).
The argument of the list is value and will become a list of elements of that array.
Declares a dynamic array using dim and ReDim statements. First, you use the Dim statement to declare a dynamic array that uses empty parentheses. Then, at the point after your program, you use the ReDim statement to declare the number of elements. In fact, you can re declare a dynamic array that you want to get many times.
Code:
<% myarray = Array ("A", "B", "C", www.3lian.net)%>
<% =myarray (0)%>
<% =myarray (1)%>
<% =myarray (2)%>
<% =myarray (3)%>
Output:
A B C D
Language (s): VBScript
Code:
<% myarray = Array (222, 333, 444, 555)%>
<% =myarray (0)%>
<% =myarray (1)%>
<% =myarray (2)%>
<% =myarray (3)%>
<% =myarray (4)%>
Output:
111 222 333 444 555
Language (s): VBScript
Code:
<%
Dim somearray ()
...
ReDim Somearray
...
ReDim somearray
%>
Language (s): VBScript
Code:
<% Dim Threedimensionarray (22, 14, 200)%
Language (s): VBScript