On Break Stop; On Error Goto - AMSTRAD cpc 6128 User Instruction

Integrated computer/disc system
Hide thumbs Also See for cpc 6128:
Table of Contents

Advertisement

ON BREAK STOP
ON BREAK STOP
10 ON BREAK GOSUB 40
20 PRINT "program running"
30 GOTO 20
40 CLS:PRINT "Pressing [ESC] ";
50 PRINT "twice caLLs GOSUB-routine"
60 FOR t=1 TO 2000:NEXT
65 ON BREAK STOP
70 RETURN
run
COMMAND:
Disables the
ON BREAK CONT
and
ON BREAK GOSUB
command, so that future operations of the
[ESC]
key stop the program. In the above
example, the 0 N BR EA K GO S U Bcommand will operate once only, as it is then
disabled by line 65 in the 0 N BR E A K sub-routine.
Associated keywords: ON BR EAK CONT, ON BR EA K GOS UB
ON ERROR GOTO
ON ERROR GOTO ,line number>
10 ON ERROR GOTO 60
20 CLS:PRINT "If error is found, ";
30 PRINT "then List the' program"
40 FOR t=1 TO 4000:NEXT
50 GOTO 100
60 PRINT "Error detected in Line";
70 PRINT ERL:PRINT:LIST
run
COMMAND: Jumps to the
specifi~d
,line number> when an error is detected in the
program.
The form of the command 0 N ERR 0 R GOT 0
0
turns off the error trap, and
restores normal error processing by BASIC.
See also the RES U M E commando.
Associated keywords: DERR, ERL, ERR, ERROR, RESUME
Chapter 3 Page 50
Complete List of Keywords

Advertisement

Table of Contents
loading

Table of Contents

Save PDF