QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

The UBOUND function returns the largest valid index (upper bound) of an array dimension.

Syntax

result% = UBOUND(arrayName[, dimension%])

Description

Example(s)


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