Statement List

<statement list>

  ┌◄────────────────────── ; ────────────────────────┐
──┴─┬─────────────────────────────┬─<statement>──────┴─────────────────┤
    │ ┌◄────────────────────────┐ │
    └─┴─<label identifier>── : ─┴─┘

Explanation

The statements in a WFL job are grouped together in a statement list. More than one statement can appear on a line, while a lengthy statement can continue across several lines. Individual statements are distinguished by a statement separator.

The usual statement separator is a semicolon (;) appearing at the end of a statement. However, an invalid character at the start of a line also acts as a statement separator.

Each statement can be preceded by one or more label identifiers. These label identifiers can then be referred to by GO statements in the job. GO statements transfer control to the point in the job where the specified label identifier appears.

Refer to Statements for descriptions of all the statements available in WFL.

Examples

In this first example, the semicolon signals the end of a statement.

BEGIN JOB SEPARATOR/EXAMPLE1; 
IF DECIMAL( TIMEDATE(HHMMSS) ) < 120000 THEN 
    DISPLAY "Good Morning, it is now: " 
            & TIMEDATE(DISPLAY) 
ELSE 
    DISPLAY "Good Afternoon, it is now: " 
            & TIMEDATE(DISPLAY); 
WAIT(5); DISPLAY "Bye"; 
?END JOB. 

In this next example, the invalid character—the question mark (?)—in the first column of a statement implies the end of the previous statement. A semicolon must be used to separate multiple statements appearing on a single line.

?BEGIN JOB SEPARATOR/EXAMPLE2 
?IF DECIMAL( TIMEDATE(HHMMSS) ) < 120000 THEN 
     DISPLAY "Good Morning, it is now: " 
             & TIMEDATE(DISPLAY) 
 ELSE 
     DISPLAY "Good Afternoon, it is now: " 
             & TIMEDATE(DISPLAY) 
?WAIT (5); DISPLAY "Bye" 
?END JOB. 

The following example shows the use of statement label identifiers:

?BEGIN JOB LABEL/EXAMPLE3; 
STRING S; 
RETRY: 
   COPY X AS Y; 
   IF FILE Y ISNT RESIDENT THEN 
       BEGIN 
     AX: 
       S:= ACCEPT("FILE Y NOT COPIED.  AX: RETRY, OR AX: SKIP"); 
       IF S = "RETRY" THEN 
         GO TO RETRY 
       ELSE IF S = "SKIP" THEN 
              ABORT 
            ELSE 
              GO TO AX;      % Ask again. 
       END; 
?END JOB.