VBScript UBound
Function
The UBound function returns the maximum subscript indicating the dimension of an array.
Note: UBound is used together with the LBound function to determine the size of an array.
Syntax
Parameter | Description |
---|---|
arrayname | Required. The name of the array variable. |
dimension | Optional. Specifies which dimension's upper bound to return. 1 = first dimension, 2 = second dimension, and so on. The default is 1. |
Example
Example 1
Output of the above example:
Example 2
A two-dimensional array:
Output of the above example: