%SYN_SYSERRTXT

Get the formatted system error message

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
text = %SYN_SYSERRTXT([error_num])

Return value

text

The formatted operating system error message associated with the last system error or the specified error number. (a)

Arguments

error_num

(optional) The number of the system error for which you want to return message text. (n)

Discussion

%SYN_SYSERRTXT looks at the last system error or the specified error number and returns the message text for that error. The number of the last system error can be returned by calling %SYSERR.

If you want the text for the last system error, %SYN_SYSERRTXT must be called immediately following the ONERROR label of the trapped error. No intervening Synergy statements should be executed, or random results may occur due to other low-level calls affecting the system error code.

Examples

    onerror openfail
    open(1, o, "cust.ddf")
    .
    .
    .
openfail, 
    text = %syn_syserrtxt
    display(15, "ERROR: " + %string(%ernum) + " system error: " + text)