Variables Search

When a variable name is used in code, ATEasy will search for the variable to locate where it is defined. Since variables in different modules (or even in different submodules of the same module) can have the same name, ATEasy must decide which one is being referred to in the current code statement. ATEasy follows a specific search sequence and the first variable that ATEasy finds with the given name will be used.

To bypass the way ATEasy searches for a variable, you can also use the Scope Resolution Operator to specify where the variable is defined (for example, ModuleName.VariableName, such as 'Driver1.nCount'). For more information, see Scope Resolution Operator.

ATEasy statements are made up of a series of tokens. A token can be a keyword (for example, 'while'), an operator (for example, '+'), a literal (for example, number or a quoted string), or a variable name, and more. Depending on the statement used, ATEasy determines the possible token type and searches for it.

How ATEasy searches for a variable is important because variables defined in a Program, System or Driver module, or within a Procedure/Event or a Form can have the same name.

In general ATEasy will first search for a variable in the current module, the module where the variable is used, in the following order:

If the variable is not found, ATEasy will then search for public variables that are visible in other modules as follows: