Defining a printer error event function (sys.PrinterErrorFunction)ΒΆ

!temp sys.PrinterErrorFunction,,p

Printer error event function

Version >= 5.9.7 & Version >= 6.0.5

Pointer type variable which can be set to point to an event function to be called when a printer error in the run report happens, making it possible to trap such errors.

Sculptor calls the function with the following arguments:

Destination

The print destination specified in the run report command.

Location

The location number of the error in the run report logic. Currently this is always set to 1.

ErrorCode

The Windows system error code.

The function should return one of the following values:

-1

Display a standard Sculptor error message and abandon the report.

0

Abandon the report without displaying an error message.

1

Retry the report without displaying an error message. If the report fails again, the error function will be called again unless sys.PrinterErrorFunction has been set to NULL.

EXAMPLE

sys.PrinterErrorFunction = &PrinterError

!function PrinterError(Destination, Location, ErrorCode) {

    prompt "Error " + tostr(ErrorCode) + " printing to " + Destination, \
           "Retry? " button="YES",PERR_RETRY button=" NO"
    return 0
PERR_RETRY:
    return 1
}

Once the report has been completed or abandoned, the program continues with the statement following the run report command.


RELATED TOPICS

Reports

Pointer fields