Array declaration and definition

by Nirmala 2010-04-15 17:10:13

Arrays in ASP
Aarrays are variables that can store more than one value. They are used to store a series of related information.
Lets create an array called 'ss' that will hold 4 values.

<%
Dim ss
ss=Array("aa","bb","cc","dd")
for loopctr = 0 to ubound(ss)
response.write(ss(loopctr)&"
")
next
%>
UBound(ArrayName):
This function will return the highest element available in an array.
If your array has 10 elements (remember zero base) then the upper bound would be 9.
LBound(ArrayName):
This function will return the lowest element available in an array, in most cases 0.

Tagged in:

753
like
1
dislike
0
mail
flag

You must LOGIN to add comments