CitectVBA Programming Reference > CitectVBA Function Reference > Array Functions > Lbound

Lbound

Determines the value of the lower bound for the dimension of the array specified in the arguments.

Lbound expects the required argument ArrayName to be a valid variable array name. The optional argument ArrayDimension must be a whole long number indicating which dimension's lower bound is to be returned. Use 1 for the first dimension, 2 for the second, and so on.

Syntax

Lbound(ArrayName, ArrayDimension)

ArrayName:

The name of the array.

ArrayDimension:

The dimension of the array for which you want to the lower bound. If ArrayDimension is omitted, 1 is assumed.

Return Value

Returns a number of Long data type.

Related Functions

Ubound

Example

Dim Lower
Dim MyArray(1 To 10, 5 To 15, 10 To 20) ' Declare array variables.
Dim AnyArray(10)
Lower = LBound(MyArray, 1) ' Returns 1.
Lower = LBound(MyArray, 2) ' Returns 5.
Lower = LBound(AnyArray) ' Returns 1.