Chapter 8. Structured Text (ST) Programming
382
PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual
GFK-2950C
8.2.10
Exit Statement
The EXIT statement is used to terminate and exit from a loop (FOR, WHILE, REPEAT) before it would
otherwise terminate. Program execution resumes with the statement following the loop terminator
(END_FOR, END_WHILE, END_REPEAT). An EXIT statement is typically used within an IF statement.
Format
EXIT;
Where:
ConditionForExiting
An expression that determines whether to terminate early.
Example
The following code fragment shows the operation of the EXIT statement. When the variable number
equals 10, the WHILE loop is exited and execution continues with the statement immediately
following END_WHILE.
while (1) do
a := a + 1;
IF (a = 10) THEN
EXIT;
END_IF;
END_WHILE;
Summary of Contents for PACSystems RX7i
Page 357: ......
Page 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451...