Description
The Option Explicit statement forces explicit declaration of all variables in a script.
This statement has the following forms:
Option Explicit
Examples
The following example shows the basic use of this statement:
' The Option Explicit statement must be the first
' statement in your script.
' Force explicit variable declaration.
Option Explicit
Dim MyVar
' No error on this statement because MyVar is declared
MyVar = 10
' Error on this statement because MyInt is undeclared
MyInt = 10
Miscellaneous Information
Supported in Version: | 1.0 |
---|