VBScript UBound Function
Complete VBScript Reference Manual
The UBound function returns the largest subscript for a given dimension of an array.
**Tip:** The UBound function is used together with the LBound function to determine the size of an array.
Syntax
UBound(arrayname[,dimension])
| Parameters | Description |
|---|---|
| arrayname | Required. The name of the array variable. |
| dimension | Optional. Which dimension's lower bound to return. 1 = first dimension, 2 = second dimension, and so on. The default is 1. |
Example
Example 1
The example above produces the following output:
0
6
Try it »
Example 2
A two-dimensional array:
The example above produces the following output:
0
2
0
3
Try it »
Complete VBScript Reference Manual