Function PrintInit() Foundation

Initializes a printer.

Syntax
PrintInit( [<nLPTport>], ;  // Default: 1
           [<lResetRC>]  ;  // Default: .F.
         ) --> nPrinterState
Return

Returns the status of a printer as a numeric value. The bits set in the return value can be queried by IsBit(). #define constants for the bits are found in XBTPRINT.CH

Bits set in PrintInit() return value
Bit Constant Description
Bit 1 set PST_TIME_OUT Timeout error
Bit 2 set unused
Bit 3 set unused
Bit 4 set PST_TRANSFER I/O error
Bit 5 set PST_ONLINE Printer online
Bit 6 set PST_PAPER Printer out of paper
Bit 7 set PST_ACKNOWLEDGE Acknowledge from printer
Bit 8 set PST_NOT_BUSY Printer not busy

Description

The function initializes the printer connected to <nLPTport>. This defaults to 1.

If <lResetRC> is set .T. SetPRC(0,0) is called to reset the internal counters for PRow() and PCol().

Win32 allows to install printers that are not connected to physical devices (printers). The Win32-API returns a status that is useful only if a print job really has been send to a physical printer. Use PrintInit() just to ensure that the printer is available. If the printer is available you can send jobs to the printer. If Windows cannot print it prompts the user for interaction to correct the error. Since this is the behaviour of any standard Windows application we unfortunately have to be incompatible to the Clipper Tools function.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.