EXIT Statement

The EXIT is commonly used within an IF statement, inside a FOR, WHILE or REPEAT block.
EXIT Statement
Name
EXIT
Meaning
exit from a FOR, WHILE or REPEAT iteration statement
Syntax
EXIT;
Example
(* ST program using EXIT statement *) (* this program searches for a character in a string *) length := mlen (message); found := NO; FOR index := 1 TO length BY 1 DO code := ascii (message, index); IF (code = searched_char) THEN found := YES; EXIT; END_IF; END_FOR;
To insert an EXIT
  • In the language container, type
    EXIT
    .
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal