EXIT FOR
(Statement)

Forcibly exit from FOR...NEXT.

EXIT FOR

This statement exits from the FOR...NEXT loop and returns control to the position immediately following the FOR...NEXT statement.

DEFINT li1, li2, li3, li4, li5, li6, li7, li8, li9
|
|
DO WHILE li1 > li2
|
'Repeat in a pretest loop
|
IF li1 = 4 THEN EXIT DO
|
'If li1=4, exit from DO...LOOP
|
FOR li3 = 0 TO 5
|
'Repeat the process of FOR...NEXT 5 times
|
FOR li4 = li5 TO li6
|
'Repeat the process of FOR...NEXT while adding 1 to the
'value of li5 each time the process is done until li5
'becomes the value of li6
|
FOR li7 = 1 TO li8 STEP 2
|
'Repeat the process of FOR...NEXT while adding 2 to the
'value starting with 1 each time the process is done
'until the value becomes li8
|
IF li2 = 2 THEN EXIT FOR
|
'If li2=2, exit from FOR...NEXT
|
DO WHILE li2 < li9
|
'Repeat in a pretest loop
|
GOSUB *samp2
|
|
li9 = li9 + 1
|
|
LOOP
|
'Call a GOSUB *samp2 statement while li2 < li9
|
NEXT li7
|
'Repeat
|
NEXT
|
'Repeat
|
NEXT
|
'Repeat
|
li9 = 0
|
|
DO
|
'Repeat in a posttest loop
|
GOSUB *samp2
|
|
li9 = li9 + 1
|
|
LOOP UNTIL li9 < 5
|
'Call a GOSUB *samp2 statement until li9 < 5
|
LOOP
|
'Repeat
|