ErrMsg$ Function
Returns the error message which corresponds to the specified error number.
Syntax
ErrMsg$(errNumber, langID)
Parameters
- errNumber
- Specify the error number that returns a message as an integer.
- langID
- Optional. Integer expression containing the language ID based on the following values.
- 0 - English
- 1 - Japanese
- 2 - German
- 3 - French
- 4 – Simplified Chinese
- 5 – Traditional Chinese
- 6 – Spanish
If omitted, English is used.
Return Values
Returns the error message which is described in the Error Codes table.
See Also
Era Function, Erf Function, Err Function, Ert Function, OnErr Statement, Trap Statement (User defined trigger)
ErrMsg$ Function Example
The Following items are returned in the program example below.
- In which task the error occurred (Ert function)
- Where the error occurred (Erl function)
- On which joint the error occurred (Era function)
Function main
OnErr Goto eHandler
Do
Call PickPlace
Loop
Exit Function
eHandler:
Print "The Error code is ", Err
Print "The Error Message is ", ErrMsg$(Err)
errTask = Ert
If errTask > 0 Then
Print "Task number in which error occurred is ", errTask
Print "The line where the error occurred is Line ", Erl(errTask)
If Era(errTask) > 0 Then
Print "Joint which caused the error is ", Era(errTask)
EndIf
EndIf
Fend