Navigation:  thinBasic language > 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.

 

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) as LONG

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

 

 

 

© 2004-2008 thinBasic. All rights reserved. Version 1.6.0.9 Web Site: http://www.thinbasic.com