All Statements
STATEMENT: Option Explicit
Implemented in version 1.0
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,yourvar
myvariable = 123.456
yourvar = 0
%>
< /BODY >
< /HTML >
Copyright 1999-2004 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information