SYS_LAST_ERR_SYSTXT

Use the SYS_LAST_ERR_SYSTXT script function to retrieve the last-occurred error message from the operating system.

Syntax

SYS_LAST_ERR_SYSTXT ()

Return Codes

The script function returns the error text of the last error that has occurred in the operating system, or an empty string if no error has occurred.

Example

The following example checks the memory of a drive. An error occurs if it is not available. The message text of the operating system ("System cannot find specified path.") will then be sent to the specified user.

:SET &CHECK# = GET_FILESYSTEM("WIN21G", "Z:\", FILESYSTEM_SPACE_TOTAL)
:
SET &MESSAGE# = SYS_LAST_ERR_SYSTXT()
:
IF &MESSAGE# NE ""
:   
SEND_MSG BU,BU,"System error: &MESSAGE#"
:
ENDIF

See also: