EXIT |
Purpose | To exit from a WHILE.. ENDWHILE or FOR....NEXT loop |
Syntax |
This new command is only available to PLC with firmware version r75 and above. Instead of using the GOTO command to get out of the loop, the EXIT command will orderly end a WHILE..ENDWHILE loop or a FOR...NEXT loop and jump to the next statement after the ENDWHILE or the NEXT command |
Examples | S = 1 WHILE S S = S+1 IF S >= 100 EXIT: ENDIF DELAY 1 ENDWHILE X$ = INPUT$(1) |
Comments: | When S has been incremented to 100, the CPU will exit the loop and continue executing the command after the ENDWHILE statement, which is the X$ = INPUT$(1)statement. |
See Also | WHILE..ENDWHILE , FOR..NEXT , CONTINUE |