- The Fundamentals of VBScript
- VBScript Versus VB
- Creating Variables in VBScript
- Concatenating Strings
- Arrays and Loops
- Resizing Arrays
- Inequality Operators
- Conditional Statements
- Select Case Statements
- Sub
- Function
- Working with Arguments
- Beware of Types
- Event Procedure Naming Syntax
- Server-Side Events
- Local Variables
- Script-Level Variables
Local Variables
Local variables are declared within a procedure. The variable lives only as long as the procedure is in force. After the procedure terminates, the variable is removed from memory and the value assigned to it vaporizes.
Please look at the code in Listing 3.11. Notice that the event procedures image1_OnMouseMove() and button1_OnClick() have a variable, s. These are two distinct variables. Each s variable is local to the specific event procedure. Each variable is created when the event procedure is run. When the event procedure ends, the s variable is removed from memory.