Option Explicit
The Option Explicit directive enforces stricter variable
definitions in your script. When this statement is placed at
the beginning of your script, all variables must be declared
before they are used with the Dim statement. If a variable
is not defined, the script will throw a runtime error.
The use of Option Explicit is highly encouraged since it
allows you to check for variables which you forgot to define. You
should make sure and declare all of the variables that are used in
your script because it will increase the performance.
It is especially important to declare all of the variables used
inside of a subroutine or function. If you fail to declare these
variables, they will assume that they are in the global variable
scope and could cause conflicts or weird errors in your script.
Option Explicit Dim sVar
sVar = 10 ' no error here
sVar2 = 11 ' throws a runtime error
|
 |

|