ASP/VBScript Array() Provides methods for creating, manipulating, thereby serving as the base class for all arrays in the common language runtime.
ShotDev Focus:
- Using ASP and Array.
Example 1
- <% myarray = Array("A", "B", "C", "D") %>
- <% =myarray(0) %> <br>
- <% =myarray(1) %> <br>
- <% =myarray(2) %> <br>
- <% =myarray(3) %> <br>
Example 2
- <%
- Option Explicit
- Dim i,arrVar(4)
- arrVar(0) = 1
- arrVar(1) = 2
- arrVar(2) = 3
- arrVar(3) = 4
- arrVar(4) = 5
- For i = 0 To UBound(arrVar)
- Response.write arrVar(i)&"<br>"
- Next
- %>
Example 3
- <%
- Option Explicit
- Dim i,arrVar(4,1)
- arrVar(0,0) = 1
- arrVar(0,1) = 1.1
- arrVar(1,0) = 2
- arrVar(1,1) = 2.2
- arrVar(2,0) = 3
- arrVar(2,1) = 3.3
- arrVar(3,0) = 4
- arrVar(3,1) = 4.4
- arrVar(4,0) = 5
- arrVar(4,1) = 5.5
- For i = 0 To UBound(arrVar)
- Response.write arrVar(i,0)&" - "&arrVar(i,1)&"<br>"
- Next
- %>