ISPRINTER

ISPRINTER()

Determine whether LPT1 is ready

Syntax

      ISPRINTER() --> lReady

Returns

ISPRINTER() returns true (.T.) if LPT1 is ready; otherwise, it returns false (.F.).

Description

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.

Examples

      .  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

Seealso

SET DEVICE, SET PRINTER

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s