Authors
Publication
Pub Details
Date
Pages
This utility is mostly used for error trapping on the Spectrum but can be used on a TS2068 also.
It features 2 modes: On Error – Go to and On Error – Continue.
The codes are completely relocatable and are 123 bytes long. To load these codes just CLEAR base-1 (if over 23756): LOAD “ON ERROR”CODE base (address to be loaded at).
To use the ON ERROR:
GOTO:10 RANDOMIZE line # (where to go if error occurs)
20 RANDOMIZE USR base
And then you’re all set. Now if an error occurs, it will be trapped and go to the line indicated in the 1st RANDOMIZE.
To use the ON ERROR:
CONTINUE:10 RANDOMIZE 10000 (over 9999)
20 RANDOMIZE USR base
What this will do is continue even if there is an error (break, stop, or tape error) if any other than those (variable not found, nonsense in basic, etc.) the program might crash. This is normal since it always sees an error it will go into a loop.
To turn off the ON ERROR:
10 RANDOMIZE USR (base+2)
(Line numbers are just examples, they may be changed to suit your needs.)