Script Statement: Sets error number and text
:SET_LAST_ERR Number, [Insert]
Syntax |
Description/Format |
---|---|
Number |
Error number |
Insert |
Error text, variable part of the error message |
This script statement :SET_LAST_ERR sets error number and text. This statement overwrites error numbers and/or the variable part of the preceding error message. The specification of Insert is optional. If Insert is not specified, the variable part of the error message is an empty string.
Be careful to specify a valid error number. A list of all available messages including their texts is found in the message manual.
A message can be composed of several parts. Separate these parts with a "|". Their order can also be seen from the message manual.
Error numbers and text can be deleted with :SET_LAST_ERR 0.
The complete modified error message can be retrieved with GET_MSG_TXT.
In the example shown below, error number "20657" is set with the two variable message parts.
:SET_LAST_ERR 20657,"MM.DAY|20||OBJECTS"
:SET &ERRINS# = SYS_LAST_ERR_INS()
:SET &ERRNR# = SYS_LAST_ERR_NR()
:SET &MSG# = GET_MSG_TXT(&ERRNR#, &ERRINS#)
:PRINT &MSG#
Extract from the message manual: 20657 - Runtime error in object '&01', line '&02'. Destination folder '&04' not found.
The result of the script statement is:
U0020657 Runtime error in object 'MM.DAY', line '20'. Destination folder 'OBJECTS' not found.
See also:
Script element | Description |
---|---|
Supplies the variable message part of the error that has last occurred | |
SYS_LAST_ERR_NR | Returns the number of the error that has last occurred |
SYS_LAST_ERR_SYSTXT | Retrieves the last-occurred error message from the operating system |
Script Elements - Error Handling and Messages
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by function