Err; Error - AMSTRAD cpc 6128 User Instruction

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

Advertisement

ERR
ERR
GOTO 500
Line does not exist
Ready
PRINT ERR
8
FUNCTION: Reports the number of the last ERRor encountered. See the listing of
error messages given in the chapter entitled 'For your reference .... '. In the above
example you will see that ER Rornumber 8 is a 'L
in e doe
s
no t ex i
s
t'
error.
Associatedkeywords: DERR, ERL, ERROR, ON ERROR GOTO, RESUME
ERROR
ERR 0 R <integer expression>
10 IF INKEY$="" THEN 10 ELSE ERROR 17
run
COMMAND: Invokes the error specified in the <integer expression>. A listing of error
messages 1 to 32 is given in the chapter entitled 'For your reference .... '. BASIC will
treat the ERR 0 R .as if it had been detected as genuine, and will jump to any error
handling routine, as well as reporting the appropriate values of ERR and ER L.
ERR 0 R accompanied by an <integer expression> in the range 33 to 255 can be used to
create customised error messages, as shown in the following example:
10 ON ERROR GOTO 100
20 INPUT "enter one character";a$
30 IF LEN(a$)<>1 THEN ERROR 100
40 GOTO 20
100 IF ERR=100 THEN 110 ELSE 130
110 PRINT CHR$(7)
120 PRINT "I said ONE character!"
130 RESUME 20
run
Associatedkeywords: ERL, ERR, ON ERROR GOTO, RESUME
Chapter 3 Page 26
Complete List of Keywords

Advertisement

Table of Contents
loading

Table of Contents