Declaring Variables

<< Click to Display Table of Contents >>

 

Declaring Variables

Users can declare variables implicitly or explicitly.

To declare a variable implicitly, simply use its name on a script. A variable is automatically created and initialized with its attribution value or it remains with an Empty value, in case it does not receive any value before using it.

This is a quick practice, but if a script is very large, it may cause confusion and creation of more than one variable with the same name, generating errors in the script.

To declare variables explicitly, use the Dim command, as in the next example.

Dim Temperature

 

Users can declare multiple variables by separating each variable's name by a comma, as in the next example.

Dim Left, Right, Top, Bottom

 

Because all scripts in E3 are linked to a specific object, variables are always local, valid only inside a script's scope. For public or global variables, users must create an Internal Tag and then use it to store a value.

Was this page useful?