GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Download
  • News
  • Community
  • Resources
  • Language Reference
  • SmallBASIC Manual

This view

  • Original page
  • New address

GeezerVison is showing smallbasic.github.io — SmallBASIC | LBOUND

Edit History

LBOUND

lb = LBOUND (array [, dim])

Home > Reference > Data

Returns the lower bound lb of an array array. dim can be used to specify, at which dimension the lower bound should be returned if array is a multi-dimensional array. If dim is not used the lower bound of the first dimension will be returned.

See UBOUND for upper bound of an array.

Example 1: Lower bound of one-dimensional arrays

dim A(5)
dim B(5 to 10)

print lbound(A)     ' Output: 0
print lbound(B)     ' Output: 5

Example 2: Lower bound of multi-dimensional arrays

dim A(5,6,7)
dim B(5 to 10, 7 to 12, 9 to 14)

print lbound(A, 2)     ' Output: 0
print lbound(B, 2)     ' Output: 7

Example 3: Using option base 1

option base 1

dim A(5)
dim B(5 to 10)

print lbound(A)     ' Output: 1
print lbound(B)     ' Output: 5
Code samples using LBOUND
006 arrays+.bas   base64.bas  
Data
APPEND   ARRAY   DATA   DELETE   DIM   EMPTY   ERASE   INSERT   ISARRAY   ISDIR   ISFILE   ISLINK   ISMAP   ISNUMBER   ISSTRING   LBOUND   LEN   READ   REDIM   RESTORE   SEARCH   SORT   SWAP   UBOUND  
This page was last edited on Mon, 19 May 2025 20:44:43 +0930 | Markdown processed with pandoc 3.1.12.1
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.