STATEMENT: OPTION EXPLICIT
OPTION EXPLICIT
The OPTION EXPLICIT statement forces the explicit declaration of all variables using
the DIM, PRIVATE, PUBLIC, or REDIM statements.
In a long program, this statement prevents the accidental reuse of the name of a previously declared variable.
Also, if you mistype a declared variable's name or try to use an undeclared variable, an error message is generated.
Note that the OPTION EXPLICIT statement must be placed at the top of the code before any other VBScript commands
or any HTML code.
Code:
<% OPTION EXPLICIT %>
<
HTML >
< HEAD >
<
TITLE > EXAMPLE < /TITLE >
< /HEAD >
< BODY >
<% DIM
myvariable = 123.456 yourvar = 0 %>
< /BODY
>
< /HTML >
Copyright 1999 by Infinite Software Solutions, Inc.
Trademark Information