pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
12 Statements
Statements—also known as executable statements—perform operations in a program. They can
modify the program’s data or control the program’s flow.
Table 55 Summary of Statements
OperationStatementCategory
Conditionally calls a procedureASSERTProgram control
Calls a procedure or subprocedureCALL
Selects a set of statements based on a
selector value
CASE
A post-test loop that repeatedly executes
a statement until a specified condition
becomes true
DO-UNTIL
Executes a pretest loop n timesFOR
Unconditionally branches to a label
within a procedure or subprocedure
GOTO
Conditionally selects one of two
possible statements
IF
Returns from a procedure or a
subprocedure to the caller; returns a
RETURN
value from a function; returns a
condition code value
Executes a pretest loop while a
condition is true
WHILE
Stores a value in a variableAssignmentData transfer
Stores a value in a bit or in a group of
sequential bits
Bit-Deposit Assignment
Scan data for a test character,
left-to-right and right-to-left, respectively
SCAN and RSCANData scan
Removes either a label (from the symbol
table) or a temporary variable that was
created by a USE statement
DROPData allocation
Creates a temporary variableUSE
In addition to the statements summarized in Table 55 (page 199), this section describes:
• Using Semicolons in Statements (page 199)
• Compound Statements (page 200)
Using Semicolons in Statements
You use semicolons with statements as follows:
• A semicolon is required between successive statements.
• A semicolon is optional before an END keyword that terminates a compound statement.
• A semicolon must not immediately precede an ELSE or UNTIL keyword.
• A semicolon alone in place of a statement creates a null statement. The compiler generates
no code for null statements. You can use a null statement wherever you can use a statement
except immediately before an ELSE or UNTIL keyword.
Using Semicolons in Statements 199