Option Base (statement)

<< Click to Display Table of Contents >>

Option Base (statement)

Option Base {0|1}

Defines the default lower bound for array indices. The allowed values are 0 and 1.

If Option Base is not specified, the lower bound of all arrays that do not explicitly specify their lower bound is 0.

This statement must reside outside a procedure and before all array definitions.

See also: Dim, LBound, section Arrays

Example:

Option Base 1

Sub Main

 Dim A(20)

 Print "The lower bound of the array is: " & LBound(A) & "."

 Print "The upper bound of the array is: " & UBound(A) & "."

End Sub