[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
+---------------------------------+
| ERROR |
+---------------------------------+
ERROR()
-----------------------------------
Returns error number corresponding to error that triggered ON ERROR
routine.
Return value - Numeric
-----------------------------------
An ON ERROR routine must be active for the ERROR() function to return a
value other than 0.
When an error is trapped during program execution, the type of error can
be identified with ERROR() in an ON ERROR routine. Corrective measures
may then be taken before proceeding with the program. The corresponding
error description may be returned with the MESSAGE() function.
The ERROR() function is reset by the RETURN or the RETRY commands.
See the Error Messages topic in this help facility for a listing of
error numbers and their corresponding error messages.
+---------------------------------+
| Program Example |
+---------------------------------+
This example shows simple error handling routine, and message that is
issued when error is encountered.
CLEAR
ON ERROR DO errhand WITH ERROR(), MESSAGE()
* The next line generates an error since there is no BRWSE command
BRWSE
ON ERROR
RETURN
*** Errhand ***
PROCEDURE errhand
PARAMETER errnum,message
@ 23,0 SAY Message+' ERROR: '+STR(Errnum)
RETURN
-----------------------------------
See Also: MESSAGE(), ON ERROR, RETRY, RETURN
-----------------------------------
See Also:
MESSAGE()
ON ERROR
RETRY
RETURN
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson