Actions and Scripts

Actions are the instructions that link states by giving the conditions under which state transfers occur. The only limiting factor on the number of actions created is the available memory (RAM). Changing states allows such effects as popping up a new window or switching to a new mode of operation.

An action has a trigger condition and possibly either or both a destination state and a script block. When the action trigger becomes true (i.e. non-zero), the script is executed. A script is a list of statements that are executed from start to finish in order. The destination state for an action specifies the state to switch to when the trigger becomes true (after the script has executed, if one exists). If no state is specified, no state change occurs but the script is still executed.

Actions are part of a state, like statements. Actions are ignored when they are not in an active state. Once the state change occurs upon an action triggering, that action becomes inactive.

A typical action might look like the following example. Here, the first line contains both the action trigger "If  TimeOut(1, 5)" and the destination state "Start".  The square brackets delineate the script block.

If TimeOut(1, 5) Start;

[

  X = 0; 

]

The trigger statement will become true 5 seconds after the state containing this code becomes active.  When this happens, X will be set to 0 and execution switch to a state named Start.

You can find more information on the format of actions in the topic Action Format.

Topics in this section:

Event-Driven Execution and Efficiency

The Trigger

The Destination

The Script Block