1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-16 09:35:15 +00:00
qb64/internal/help/LBOUND.md

38 lines
874 B
Markdown

The [LBOUND](LBOUND) function returns the smallest valid index (lower bound) of an array dimension.
## Syntax
> result% = [LBOUND](LBOUND)(arrayName[, dimension%])
## Description
* arrayName specifies the name of the array.
* dimension% specifies the dimension number, starting with 1 for the first dimension.
* If omitted, dimension% is assumed to be 1.
* If dimension% is less than 1 or is greater than the number of dimensions, a [ERROR Codes](ERROR-Codes) error occurs.
* [LBOUND](LBOUND) and [UBOUND](UBOUND) are used to determine the range of valid indexes of an array.
## Example(s)
```vb
DIM myArray(5) AS INTEGER
DIM myOtherArray(1 to 2, 3 to 4) AS INTEGER
PRINT LBOUND(myArray)
PRINT LBOUND(myOtherArray, 2)
```
```text
0
3
```
## See Also
* [Arrays](Arrays), [UBOUND](UBOUND)
* [DIM](DIM), [COMMON](COMMON), [STATIC](STATIC), [SHARED](SHARED)