Errmes$
errmes$
returns the message associated with a numeric error code available when an error occurs. It is frequently used when the error code errn is used, in the error handling routine set by Onerrgo.
errmes$(INT_EXPR)
INT_EXPR
is an expression returning an integer value.# Example 1 : What does error 10 mean ?Local Char ERROR_10(200)ERROR_10=errmes$(10) : # if connected in English, contains "Incompatibility of Type"# Example 2 : Let's trigger an error (division by zero)Funprog DIV_BY_ZEROLocal Integer ZERO, ONE, RESULTLocal Char ERROR_MESSAGE(250)ONE=1 : ZERO=0Onerrgo ERR_HANDLERESULT = ONE / ZEROEnd ERROR_MESSAGE$ERR_HANDLEERROR_MESSAGE="Error"-num$(errn)-"raised on line"-num$(errl)-"in script"-errp-"Message:"-errmes$(errn)&-"Additional details:"-errmResume
errmess$
returns the description associated with an error code that is assigned when an error occurs on a script. The result type is Char. The message returned depends on the connection language.
As errn
only has a significant value in the error handling routine, errmes$
should be primarily used in error handling routines.
In the different script glossary documentations, the Associated errors chapter provides the value of the errors that can occur for each instruction or function. The message can be retrieved by using errmes$
with the given error values, even directly from the calculator.
Error code | Description |
---|---|
10 | The argument is not numeric. |
50 | Negative argument. |
errl, errp, Onerrgo, errn, errm.