17.01.2013 Views

AmstradCPC6128-hypertext-en-Sinewalker

AmstradCPC6128-hypertext-en-Sinewalker

AmstradCPC6128-hypertext-en-Sinewalker

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ERR<br />

ERR<br />

GOTO 500<br />

Line does not exist<br />

Ready<br />

PRINT ERR<br />

8<br />

FUNCTION: Reports the number of the last ERRor <strong>en</strong>countered. See the listing of<br />

error messages giv<strong>en</strong> in the chapter <strong>en</strong>titled 'For your refer<strong>en</strong>ce .... '. In the above<br />

example you will see that ER Rornumber 8 is a 'L in e doe s no t ex i s t' error.<br />

Associatedkeywords: DERR, ERL, ERROR, ON ERROR GOTO, RESUME<br />

ERROR<br />

ERR 0 R <br />

10 IF INKEY$="" THEN 10 ELSE ERROR 17<br />

run<br />

COMMAND: Invokes the error specified in the . A listing of error<br />

messages 1 to 32 is giv<strong>en</strong> in the chapter <strong>en</strong>titled 'For your refer<strong>en</strong>ce .... '. BASIC will<br />

treat the ERR 0 R .as if it had be<strong>en</strong> detected as g<strong>en</strong>uine, and will jump to any error<br />

handling routine, as well as reporting the appropriate values of ERR and ER L.<br />

ERR 0 R accompanied by an in the range 33 to 255 can be used to<br />

create customised error messages, as shown in the following example:<br />

10 ON ERROR GOTO 100<br />

20 INPUT "<strong>en</strong>ter one character";a$<br />

30 IF LEN(a$)1 THEN ERROR 100<br />

40 GOTO 20<br />

100 IF ERR=100 THEN 110 ELSE 130<br />

110 PRINT CHR$(7)<br />

120 PRINT "I said ONE character!"<br />

130 RESUME 20<br />

run<br />

Associatedkeywords: ERL, ERR, ON ERROR GOTO, RESUME<br />

Chapter 3 Page 26 Complete List of Keywords

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!