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

Return Codes

The script function has the following return codes:

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:

seealso

Script Elements for Error Handling