Purpose
Returns the current size of an array. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
UBound( array )
array is the name of an array variable.
Return Value
Integer
Description
The UBound() function returns an integer value indicating the current size (or "upper bound") of an array variable.
Every array variable has an initial size, which can be zero or larger. This initial size is specified in the variable's Dim statement or Global statement. However, an array's size can be reset through the ReDim statement. The UBound() function returns an array's current size, as an integer value indicating how many elements can currently be stored in the array. A MapBasic array can have up to 32,767 items.
Example
Dim matrix(10) As Float
Dim depth As Integer
depth = UBound(matrix)
' depth now has a value of 10
ReDim matrix(20)
depth = UBound(matrix)
' depth now has a value of 20
See Also:
Dim statement, Global statement, ReDim statement