EasyManua.ls Logo

Sharp MZ-800 - 6.8 Error Processing Statements

Sharp MZ-800
221 pages
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...
6.8
Error
Processing
Statements
ON
ERROR
GOTO
Format
ON
ERROR
GOTO
Bese
number
>
<label>
Explanation
Example
Abbreviated
Format
ON
ERR.
G.
2
The
ON
ERROR
GOTO
statement
causes
program
execution
to
branch
to
<line
number>
or
<label>
if
an
error
occurs.
The
ERN
or
ERL
system
variable
can
be
used
in
a
trap
routine
starting
at
that
line
to
control
subsequent
processing
ac-
cording
to
the
type
of
error
and
the
line
number
in
which
it
occurred.
Including
a
RESUME
statement
at
the
end
of
the
error
processing
routine
makes
it
possible
to
return
execution
to
the
line
at
which
the
error
occurred.
Executing
an
ON
ER-
ROR
GOTO
statement
cancels
the
error
trap
line
number
defined
by
the
previous
ON
ERROR
GOTO
statement.
The
error
trap
line
number
definition
is
also
can-
celled
by
executing
a
CLR
statement.
10
ON
ERROR
GOTO
100
20
INPUT
“*X="";X
30
PRINT
SQR(X)
40
END
100
PRINT
“‘ERROR’’
110
RESUME
20
The
program
above
displays
the
message
“ERROR”
and
returns
to
line
20
if
an
error
occurs.
6-87
_

Other manuals for Sharp MZ-800

Related product manuals