Previous Topic

Next Topic

Inhoudsopgave

Book Index

Isah Script Variables

Description

In Isah VBScripting, a variable can be thought of as a place to store a value in computer memory. For example, you can create a variable called MyString to store a text that you wish to display in multiple message boxes. You only have to refer to this variable by using its name to see the variable's value or to change this value. Note that this value may change during the time your script is running.

Declaring Variables

Always explicitly declare variables in your script using the Dim statement. You can use the following types of variables in Isah VBScripting:

You can assign values to all variables directly, except for object variables. Use an intruction to assign objects to an object variable.

To help prevent errors, it is recommended to you use local variables where possible. The distinction between global variables and local variables is that global variables are declared at the beginning of your script and are valid and available for the entire script. Local variables, on the other hand, are declared at the start of a new procedure or function and are only available for that procedure or function.

Example

Sub Main()

Dim MyString

Dim ObjectVariable

MyString = "Hello world"

Set ObjectVariable = Application.DataBase

End Sub