New constructs

The ASCII state table syntax introduces some new constructs that are not present in the state table editor, as shown in the example in Table 1

Table 1. Syntax of exported actions

Shorthand Syntax

Exported Syntax

nResult = nNumber1 + nNumber2 ;
AssignData ( nResult
            , nNumber1
            , "ADD"
           , nNumber2
            ) ;

The shorthand constructs are not preserved when the state table is re-exported (that is, the longer syntax is used).

When you import a keyword, such as “ADD” in the example, above remember to put double quotes around the keyword to prevent a possible clash with a variable of the same name.

Table 2 table shows how other shorthand constructs are treated by import and export:

Table 2. Examples of exported syntax

Shorthand Syntax

Exported Syntax

if ( expression )
then
  <statements>
else
  <other statements>
endif
label   Action
IF_1    EvaluateData
        <statements>
ELSE_1  DoNothing
        <other statements>
ENDIF_1 DoNothing
while ( expression )
do
  <statements>
endwhile
label      Action
WHILE_1    EvaluateData
           <statements>
ENDWHILE_1 DoNothing
case ( variable )
  when value:
    <statements>
    .
    .
    .
  otherwise :
   <default statements>
endcase
the CaseAction action

Avoid using labels such as ‘WHILE_1’ and ‘IF_1’ in your state tables because they will conflict with those in the exported syntax and may cause unpredictable results when the state table is run.