4 TRON
5 OPEN "output" FOR OUTPUT AS 1
7 ON ERROR GOTO 1000
10 FOR I=5 TO 10
20 PRINT#1, I
30 IF I=5 GOTO 50
40 'NEXT
50 PRINT I
60 IF I=5 THEN NEXT
70 PRINT#1,"end"
80 NEXT
999 CLOSE:END
1000 PRINT#1, "error:", ERR, ERL: PRINT ERR, ERL: RESUME NEXT

