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:
  1. ScreenC completes Part 1 of a task and increments $intPartsComplete$ using a Variable update action.
  2. ScreenG completes Part 2 of a task and increments $intPartsComplete$ using a Variable update action.
  3. 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.
  4. ScreenS completes Part 3 of a task and increments $intPartsComplete$ using a Variable update action.
  5. ScreenZ displays the value of $intPartsComplete$ using a Message action.
In the example above, actions in several different macro screens are able to read from or write to the variable $intPartsComplete$.