WINPRINT-GET-SPOOL-ERR

This operation code obtains the number of the most recent Windows Graphical Device Interface (GDI) error from the Windows API.

Usage

CALL "WIN$PRINTER"
    USING WINPRINT-GET-SPOOL-ERR
    GIVING RESULT

Return Values

This operation returns the most recent Windows GDI error.

Description

The complexity of Windows graphics capabilities make it impossible to catalog all possible error conditions in winprint.def. Therefore, if a graphical error condition occurs, the WIN$PRINTER op-code that caused the error returns WPRTERR-SPOOL-ERR to indicate that a Windows API error occurred. Use WINPRINT-GET-SPOOL-ERR to retrieve the specific Windows API error number, then refer to Windows API documentation for a description of the problem.

This operation should be called immediately after a WIN$PRINTER operation call has returned WPRTERR-SPOOL-ERR. Calling this function under other circumstances will return unpredictable values. This operation does not impact WRITE statements.

Note: Calling WINPRINT-GET-SPOOL-ERR does not reset the last GDI error internally. Do not use this operation as a method to verify that a call worked properly.