Declaring Variables

A variable is a convenient placeholder that refers to a computer memory location where you can store program information that may change during the time your script is running. In VBScript, variables are always of one fundamental data type, Variant.

You declare variables explicitly in your script using the Dim statement, the Public statement, and the Private statement. For example:
  Dim DegreesFahrenheit  
You declare multiple variables by separating each variable name with a comma. For example:
  Dim Top, Bottom, Left, Right  

You can also declare a variable implicitly by simply using its name in your script. That is not generally a good practice because you could misspell the variable name in one or more places, causing unexpected results when your script is run. For that reason, the Option Explicit statement is configured by default in the Global Procedures interface to require explicit declaration of all variables. Unless you delete this statement, you need to declare all variables explicitly; otherwise, VBScript will generate errors during runtime indicating that the variable does not exist.

An expression should have the variable on the left side and the value you want to assign to the variable on the right. For example:
  MyVar = 100  

Declaring Variables