LBOUND function

Purpose

Return the smallest possible subscript (boundary) for an array's specified dimension.

Syntax

y& = LBOUND(array [(dimension)])

y& = LBOUND(array, dimension)

Remarks

LBOUND can be used in combination with UBOUND to determine the size of an array.  LBOUND of an undimensioned array returns zero.  The LBOUND function has the following parts:

array

Name of the array of interest.

dimension

An integer indicating which dimension's lower bound is returned.  If not specified, the first dimension is assumed.

Restrictions

LBOUND cannot be used on arrays within User-Defined Types.

See also

ARRAYATTR, DIM, REDIM, UBOUND

Example

' Dimension an array with lower and upper bounds

DIM MyArray%(1900 TO 2000,5 TO 10)

' get the values of the array

l1 = LBOUND(MyArray%)

u2 = UBOUND(MyArray%)

l2 = LBOUND(MyArray%(2))

u2 = UBOUND(MyArray%, 2)