Option Base Statement |
Option Base {0 | 1}
Used at the beginning of a module to specify the default lower bound for arrays dimensioned within the module.
The default lower bound for arrays created in Visual Basic is 0. Therefore, you should only use Option Base 1 to change the default base for arrays to 1.
The Option Base statement must appear at the start of a module, before any array declarations.
The Option Base statement affects only those arrays declared in the module in which the Option Base statement appears.
Another more flexible method of specifying the lower bound of an array (other than the default) is to use the To clause when dimensioning an array, as the following snippet shows:
Dim myArray(1 to 50) As String
Option Base doesn't affect the lower bound of arrays created with the Array function or the ParamArray keyword; these are always base 0.