devxlogo

Always Use Option Explicit

Always Use Option Explicit

You should always use Option Explicit statement in your .asp file. Thisstatement will enforce that you explicitly declare all the variables in thescript. The whole problem: VBScript allows you to usevariables without explicitly declaring them. Turning on this option helpsyou in identifying undefined variables.
The Option Explicit statement must appear in a script before any procedures.When you use the Option Explicit statement, you must explicitly declare allvariables using the Dim, Private, Public, or ReDim statements. If you try touse an undeclared variable name, an error occurs. Using Option Explicitmakes undeclared local variables illegal. Undeclared local variables are asslow as global variables. Another added advantage of using this statement isthat you move towards a more maintainable code as all the variables aredeclared before usage.

devx-admin

Share the Post: