Determine whether LPT1 is ready
ISPRINTER() --> lReady
ISPRINTER() returns true (.T.) if LPT1 is ready; otherwise, it returns false (.F.).
ISPRINTER() is a printer function that determines whether the parallel port (LPT1) is online and ready to print. ISPRINTER() is hardware-dependent and, therefore, only works on IBM BIOS compatible systems.
You can check ISPRINTER() to make sure the printer is ready before you begin a print operation; however, if an error occurs during the print operation, a runtime error is generated.
. This example tests the parallel port for readiness with up to 25 retries. If the parallel port is ready, the printer operation begins: LOCAL nCount := 0, nTimes := 25, lReady // DO WHILE nCount++ <= nTimes .AND. !(lReady := ; ISPRINTER()) ENDDO // IF lReady REPORT FORM Sales TO PRINTER ELSE ? "Printer not ready..." BREAK ENDIF
SET DEVICE, SET PRINTER