Specifications

5.1 ST
5.1.3 Syntax in ST language
5-7
5
WRITING
PROGRAMS
(6) FOR...DO syntax
(a) Format
(b) Description
The FOR...DO syntax repeats the execution of several syntax according to the value of
a repeat variable.
(c) Example
(7) WHILE...DO syntax
(a) Format
(b) Description
The WHILE...DO syntax executes one or more syntax while the value of Boolean
expression (conditional expression) is TRUE.
The Boolean expression is evaluated before the execution of the syntax. If the value of
Boolean expression is FALSE, the syntax in the WHILE...DO syntax is not executed.
Since a return result of the Boolean expression in the WHILE syntax requires only
TRUE or FALSE, any Boolean expression that can be specified in the IF conditional
syntax can be used.
(c) Example
FOR <Repeat variable initialization>
TO <Last value>
BY <Incremental expression> DO
<Syntax ...>;
END_FOR;
WHILE <Boolean expression> DO
<Syntax ...>;
END_WHILE;