off end Example10 CLEAR SCREEN
20 PRINT "*** output TEST ****"
30 CREATE "test.txt",0
40 ASSIGN @File TO "test.txt";FORMAT ON
50 ON END @File GOTO Here
60 OUTPUT @File;"This is a test"
70 OUTPUT @File;"This is a test - line 2"
80 RESET @File
90 FOR Loop=1 TO 5
100 ENTER @File;Test$
110 PRINT Test$,Loop
120 ON ERROR GOTO 190
130 IF Loop=1 THEN OFF END @File !This causes an error after first loop iteration.
140 NEXT Loop
150 Here: !
160 PRINT "OFF END command did not work properly"
170 ASSIGN @File TO *
180 STOP
190 OFF ERROR
200 ASSIGN @File TO *
210 PRINT "Test Passed"
220 PURGE "test.txt"
230 END
|