Difference between revisions of "OPTION BASE"

From QB64 Wiki
Jump to navigation Jump to search
(Created page with ''''OPTION BASE 1''' is used to set the lowest array element to 1. Otherwise, arrays will be dimensioned from element 0 if you DIM just the upper bounds. It should be set before …')
 
Line 1: Line 1:
 
'''OPTION BASE 1''' is used to set the lowest array element to 1.
 
'''OPTION BASE 1''' is used to set the lowest array element to 1.
 +
 
Otherwise, arrays will be dimensioned from element 0 if you DIM just the upper bounds.
 
Otherwise, arrays will be dimensioned from element 0 if you DIM just the upper bounds.
  
Line 7: Line 8:
  
 
DIM Array(1 TO 200)
 
DIM Array(1 TO 200)
 +
 +
 +
''See also:'' [[UBOUND]] [[LBOUND]]

Revision as of 04:55, 28 August 2009

OPTION BASE 1 is used to set the lowest array element to 1.

Otherwise, arrays will be dimensioned from element 0 if you DIM just the upper bounds.

It should be set before any arrays are dimensioned (DIM).

Alternative: DIM arrays using upper and lower bounds as shown:

DIM Array(1 TO 200)


See also: UBOUND LBOUND