ERRN |
errn is used to give the number of an error generated in an Adonix routine.
errn
#-- EXAMPLE 1
# Division by 0 : interception of the error
Onerrgo ERR
I = 1 / 0
End
ERR
# Display of message: error no 53 on line 3
Errbox "error no"-num$(errn)-"on
line"-num$(errl)
End
#-- EXAMPLE 2
# Management of errors in evaluating a calculated
string
Local Char FORMULE(100),
RESULTAT(100)
Local Integer ERN
# In the event of error, go to ERCALC, where ERN will be
updated.
Onerrgo ERCALC
# Translation
of key-words
FORMULE = "date$$"
ERN = 0
# the formula
is evaluated and formatted as a string.
# vireblc deletes unnecessary spaces.
RESULTAT =
vireblc(format$("K:100X", evalue(FORMULE)), 2)
# If ERN is not
null, ERCALC goes to
# display of the message: "Error in calculation:
illegal character"
If ERN
Errbox "Erreur en calcul :"-errmes$(ERN)
Endif
End
# Error management sub-programme: errn only has a meaning here
ERCALC
ERN = errn
Resume
errn contains the last error number generated by Adonix when running a routine.
This error number only has meaning in an error management sub-programme called by Onerrgo. In other cases, its value may have no meaning.
The list of errors and error codes is given in the programming manual annexes.
No associated errors.
ERRL - ONERRGO - ERRBOX - ERRMES$ - ERRM
|
|