EXITTO

PURPOSE:
To prematurely exit from FOR/NEXT, WHILE/WEND, REPEAT/UNTIL loops or GOSUB subroutines.
STATEMENT SYNTAX:
{stno} EXITTO stno

EXAMPLE:
0100 FOR X=1 TO 50
0110 IF S$(X,1)="*" THEN EXITTO 0200
0120 NEXT X
0130 .........
NOTES:
When FOR/NEXT LOOPS or SUBROUTINES are in execution, the specified "exit" address is stored in what is called the RETURN ADDRESS STACK. Should a SUBROUTINE or LOOP be exited prior to its normal conclusion (using a GOTO rather than an EXITTO), then the RETURN STACK is not "cleared". While this does not cause an error it does use memory. The EXITTO command also informs someone who is trying to maintain the program what original programmers true intent was. Execution of the EXITTO command without a prior FOR or GOSUB will cause an ERROR 27.
SEE:
        FOR NEXT
        WHILE WEND
        REPEAT UNTIL
        GOSUB