GET_MSG_TXT
The GET_MSG_TXT script function retrieves the message text corresponding to the message number which is provided by the parameter Number. GET_MSG_TXT allows you to compose a complete AE error message if you use it with SYS_LAST_ERR_NR to retrieve the error number, and SYS_LAST_ERR_INS to retrieve the variable part of the error message.
Tip: Use the :ON_ERROR script statement to continue script processing even if an error occurs. Use SYS_LAST_ERR_NR to retrieve the error number, and SYS_LAST_ERR_INS to retrieve the variable part of the error message. Then use the GET_MSG_TEXT script function to retrieve the complete error message.
For more information, see Error Handling in Scripts.
Syntax
GET_MSG_TXT (Number [,Insert])
Parameters
-
GET_MSG_TXT
Retrieves the message text that is assigned to the provided message number -
Number
Error number
Format: script variable or number
Tip: Use the SYS_LAST_ERR_NR script function to retrieve the error number caused by a previous statement. -
Insert
(Optional) Variable part of the error message (text). This value is not required if the message text does not include variable parts such as in status texts whose numbers can be read with GET_STATISTIC_DETAIL
Format: script variable or number
Tip: Use the SYS_LAST_ERR_INS script function to retrieve the variable part of the error number.
Return Codes
The script function has the following return codes:
- The message text which is assigned to the provided message number incl. the variable part if one exists
- Blank if there is no text assigned
- ??? if the provided message number is invalid
Example
The following example checks the memory capacity of a non-existing drive which results in an error. The error number and the variable part of the error message are read. This information is used to retrieve the complete AE error message which is then sent to a user as a message.
:SET &CHECK# = GET_FILESYSTEM("WIN21", "Z:\", FILESYSTEM_SPACE_TOTAL)
:SET &ERRNR# = SYS_LAST_ERR_NR()
:SET &ERRINS# = SYS_LAST_ERR_INS()
:SET &MESSAGE# = GET_MSG_TXT(&ERRNR#,&ERRINS#)
:SEND_MSG
BU,BU,&MESSAGE#
The second example retrieves the text that informs about a task status.
:SET &STATUS# = GET_STATISTIC_DETAIL(&RUNNR#, STATUS)
:SET &TEXT# = GET_MSG_TXT(&STATUS#)
:PRINT &TEXT#
The output could be as shown below:
ENDED_CANCEL - manually canceled.
See also: