Navigation:  thinBasic Modules > Core > Array functions >

LBound

Previous pageReturn to chapter overviewNext page

 

Description

 

Returns the lower array bound for an array dimension.

 

Syntax

 

n = LBound(ArrayVariable[ (Dimension) ])

n = LBound(ArrayVariable[, Dimension ])

 

Returns

 

Number

 

Parameters

 

Name

Type

Optional

Meaning

ArrayVariable


No

Name of a declared array.

Dimension

Number

Yes

The dimension number inside the array. If no dimension is specified, the first dimension will be used.

 

Remarks

 

Lower bound dimension is always 1 for dimensioned arrays.

For not yet dimensioned array lower bound is always 0 (zero).

 

Restrictions

 

See also

 

UBound,

 

Examples

 

DIM MyArray(4, 8, 3) as LONG

 

MSGBOX 0, LBound(MyArray)     '---Will return 1

MSGBOX 0, LBound(MyArray(1))   '---Will return 1

MSGBOX 0, LBound(MyArray(2))   '---Will return 1

MSGBOX 0, LBound(MyArray(3))   '---Will return 1

 

REDIM MyArray(4, 8, 30)

MSGBOX 0, LBound(MyArray, 3)   '---Will return 1