Scope of variables
The scope of every variable is global with respect to the macro in which the variable is created. That is, every variable in a macro is accessible from any macro screen in the macro. All that an action or a descriptor in a macro screen has to do to access the variable is just to use the variable name.
For example, suppose that you have a variable named $intPartsComplete$
that you initialize to 0. You might use the variable in the following
ways as the macro proceeds:
- ScreenC completes Part 1 of a task and increments $intPartsComplete$ using a Variable update action.
- ScreenG completes Part 2 of a task and increments $intPartsComplete$ using a Variable update action.
- ScreenM has a Conditional action that tests whether 1 or 2 parts have been completed so far. Depending on the result, the macro expects either ScreenR or ScreenS as the next macro screen to be processed.
- ScreenS completes Part 3 of a task and increments $intPartsComplete$ using a Variable update action.
- ScreenZ displays the value of $intPartsComplete$ using a Message action.