UBound
The UBound function returns the upper bound or largest possible
index that may be used on an array.
You can think of this function as returning the size of the array.
Although it is not really the size of the array since the arrays are
indexed starting at zero. So even though the last valid index to an
array of size 10 is 10, the indices range from 0 to 10 giving you a
size of 11 elements.
Dim aArray aArray = Array(10) Response.Write "UBound(aArray) = " & UBound(aArray) & "<BR>" Dim aArray2 aArray2 = Array(0) ReDim aArray2(10) Response.Write "UBound(aArray2) = " & UBound(aArray2)
Active Server Pages also provides a lower bound function LBound
although it doesn't really serve any purpose since all arrays in ASP
must start from zero. This means the LBound function will always
return zero.
|
 |

|