bas7ex.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
OPTION BASE Statement Programming Example
                       ◄Example►                 ◄Contents►  ◄Index►  ◄Back►
──────────────────────────────────────────────────────────────────────────────
'This example uses the OPTION BASE statement to override the default
'base array subscript value of 0. Subscripts in array A range from
'1 to 20 rather than 0 to 20.
 
CLS                     'Clear screen.
OPTION BASE 1
DIM A(20)
PRINT "The base subscript in array A is"; LBOUND(A)
PRINT "The upper bound subscript in array A is"; UBOUND(A)
 
'Sample Output
'
'The base subscript in array A is 1
'The upper bound subscript in array A is 20