TAL Reference Manual

Statements
TAL Reference Manual526371-001
12-26
IF Statement
GOTO a; !Sublocal branch to local label
END;
a : !Place label at local statement
i := 0;
!More code
END;
IF Statement
The IF statement conditionally selects one of two statements.
condition
is either:
A conditional expression
An INT arithmetic expression. If the result of the arithmetic expression is not 0,
condition is true. If the result is 0, condition is false.
THEN statement
specifies the statement to execute if condition is true. statement can be any
statement described in this section. If you omit
statement, no action occurs for the
THEN clause.
ELSE statement
specifies the statement to execute if condition is false. statement can be any
statement described in this section.
Usage Considerations
If the condition is true, the THEN statement executes. If the condition is false, the
ELSE
statement executes. If no ELSE clause is present, the statement following the IF
statement executes.
You can nest IF statements to any level.
IF
condition
THEN
statement
ELSE
statement
VST1216.vsd