
7-6
Section
Details of BASIC Commands
156
error
Syntax:
ERROR
<error number>
Description:
Statement. Simulates the occurrence of an error.
Remarks:
<error number> is any valid error number in the range: [1…255].
If a system error or a BASIC program error number is used the relevant error code will be put in
the IR n+7 word and, if applicable, the error message will be printed to the screen.
If an error number is specified that does not contain an error description, for instance an undefined
user-defined error or a system error code that is not used, then an “UNDEFINED ERROR” error
code will occur.
For both system and user errors it is possible to define error handling using the
ON ERROR GOTO
statement.
ERROR
and
ON ERROR GOTO
can be used together to simulate the occurrence of an error and test
the operation of an error-processing program in an interrupt subroutine.
Examples:
>
10 ON ERROR GOTO 1000
>
20 ERROR 6
>
30 END
>
1000 PRINT "ERROR #";ERR;" OCCURRED AT LINE ";ERL
>
1010 END
>
RUN
ERROR #6 OCCURRED AT LINE 20
See also:
ON ERROR GOTO
,
ERL
,
ERR
,
ERC
exp
Syntax:
EXP
(<numerical expression>)
Description:
Function. Calculates the exponential of a numerical expression with base e.
Remarks:
<numerical expression> may be any integer, single-precision floating point or double-precision
floating point.
The return type is single-precision floating point if the argument is of type integer or single-
precision floating point. If the argument is of type double-precision floating point then the return
type is also double precision floating point.
Examples:
>
10 A = EXP(1)
>
20 PRINT A
>
RUN
2.71828
See also:
Summary of Contents for C200H-ASC11
Page 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Page 2: ...iv...
Page 4: ...vi...