UBOUND
Revision as of 00:44, 11 October 2010 by imported>Clippy
The UBOUND function returns the largest valid index (upper bound) of an array dimension.
Contents
Syntax
- result% = UBOUND(arrayName[, dimension%])
Description
- arrayName specifies the name of the array.
- dimension% specifies the dimension number, starting with
1
for the first dimension.- If omitted, dimension% is assumed to be
1
. - If dimension% is less than
1
or is greater than the number of dimensions, a subscript out of range error occurs.
- If omitted, dimension% is assumed to be
Examples
DIM myArray(5) AS INTEGER DIM myOtherArray(1 to 2, 3 to 4) AS INTEGER PRINT UBOUND(myArray) PRINT UBOUND(myOtherArray, 2)
5 4
See also