EasyManua.ls Logo

Husky Hunter - Page 202

Husky Hunter
499 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
BASIC FUNCTIONS
SECTION 5.6
5.6.5
ERROR
Function ERROR simulates a Basic error with the advantage that it
allows user defined codes. For a list of Bsic error
messages, see section 4. 14.
Syntax ERROR n
where O<n<255
Example 10 INPUTa,b
20 ONERRORGOT0100
30 IFa>bTHENERROR156
40 GOT010
100 IFERR
= 156THENPRINT"a>b error"
110 RESUME 1 0
Remarks The ERROR statement neatly traps errors and forces the
printing of a Basic error message. If the error number is
undefined in Basic, then processing can be forced to
restart at another line to print a user defined message.
When ERROR is set to n, this number may be recovered with
ERR, and the line number with ERL.
After a forced user error trap, a suitable RESUME command
must be executed to ensure correct program operation.
VER.V09F
PAGE 5 - 33