Dim
The Dim statement is used to declare a variable for use. You
can declare each variable with a separate Dim statement or
declare multiple variables by separating the variable names with
commas (,).
You should note that constants are not declared with the Dim
statement. They are declared and assigned their value with the
Const statement.
Dim sVar ' single var -- you can add comments here
Dim sVar1, sVar2, sVar3 ' this is more difficult to comment
Dim I, J, K ' but is useful for generic counters
You should make sure to declare all of your variables in Active
Server Pages because of the way that ASP manages variable storage.
Your performance will suffer if you fail to declare your variables.
If you want to make sure that all of your variables have been
declared, you can check by inserting the statement Option Explicit
at the beginning of your script. This will cause the script to throw
a runtime error when a variable is used without being declared (using the
Dim statement) first.
|
 |

|