EXIT statement
The EXIT statement is commonly used within an IF statement inside a FOR, WHILE, or REPEAT block. EXIT statements are not compliant with the IEC-61131-3 standard, and we recommend not using them.
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;
Provide Feedback