Function: OPMEX_GET_SYS_ERROR, get last system error

This topic describes the callback function OPMEX_GET_SYS_ERROR (get last system error).

The parameters and possible values for this function are shown in the following list.

Callback Parameter Contents
(return) Last known system error code
Info Not used
InfoIdx Not used
Data/DataSizeChars Text for the error (Optional)

This function returns the last system error that occurred from a callback [GetLastError() in Windows or errno in UNIX]. These values are cached from each callback and may return different results than if you called the system API yourself.

A callback may result in multiple errors, as well as non-system errors. If there are multiple errors, the first system type error is returned. If there are no system type errors, zero (0) is returned.

If you provided a Data area, the text for the error is returned. If there are multiple errors, they will all be listed within this text, separated by new lines ("\n"), including non-system errors. If there are no errors, Data will contain a null string. It may also contain non-system error text, even if this function returns zero.

OPMEX_ERR_TOOLONG is not raised for this call, so as much text as can fit in the area provided will be returned from the last error, followed by a “C” null-termination string character.