UBOUND
UBOUND
Section titled “UBOUND”Syntax
Section titled “Syntax”UBound(<array variable>)UBound(<array variable>, <dimension>)Description
Section titled “Description”Returns the array upper bound of the given dimension. If dimension is not specified, it defaults to 0.
If the given dimension is 0, then total number of dimensions is returned.
Examples
Section titled “Examples”DIM a(3 TO 5, 2 TO 8)PRINT UBound(a, 2) : REM Prints 8PRINT Ubound(a) : REM Prints 2, because it has 2 dimensionsThe result is always a 16bit integer value.
If <dimension> is 0 the number of dimensions in the array is returned
(use it to guess the number of dimensions of an array):
DIM a(3 TO 5, 2 TO 8)PRINT UBound(a, 0): REM Prints 2, since 'a' has 2 dimensionsRemarks
Section titled “Remarks”- This function does not exists in Sinclair BASIC.