GET_MSG_TYPE

Use the GET_MSG_TYPE script function to retrieve the type of a message number, as there are different types of message numbers, such as warnings and error messages.

Tip: Use the SYS_LAST_ERR_NR script function to retrieve the number of the last error message. For more information, see SYS_LAST_ERR_NR.

Syntax

GET_MSG_TYPE (Message number)

Parameters

  • GET_MSG_TYPE
    Retrieves the type of a message number

  • Message number
    Number of a message whose type should be read
    Format: script variable or number

Return codes

  • A
    Abort
  • E
    Error
  • I
    Information
  • Q
    Query
  • W
    Warning
  • " "
    The error number does not exist.

Example

The following example informs the administrator if a message has aborted or an error has occurred:

:SET &ERRNR# = SYS_LAST_ERR_NR()
:
SET &ERRTYP# = GET_MSG_TYPE(&ERRNR#)
:
IF &ERRTYP# = "A" OR "E"
:  
SET &ERRINS# = SYS_LAST_ERR_INS()
:  
SET &MESSAGE# = GET_MSG_TXT(&ERRNR#,&ERRINS#)
:  
PRINT &MESSAGE#
:  
SET &RET# = SEND_MAIL("smith@automic.com",,"Processing error",&MESSAGE#)
:
ENDIF

See also: