5.2.1.3 Option Explicit Directive

Option Explicit directives is used to set the variable declaration mode which controls whether or not variables (section 2.3) can be implicitly declared (section 5.6.10) within the containing module (section 4.2).

 option-explicit-directive = "Option"   "Explicit" 

Static Semantics:

  • If an <option-explicit-directive> is present within a module, the variable declaration mode of the module is explicit-mode.

  • If an <option-explicit-directive> is not present within a module, the variable declaration mode of the module is implicit-mode.

  • An <option-explicit-directive> can occur at most once in a <procedural-module-declaration-section> or <class-module-declaration-section>.

  • If a <procedural-module-declaration-section> or <class-module-declaration-section> does not contain a <option-explicit-directive> the variable declaration mode for the module is implicit-mode.