Check printer status


     FT_ISPRINT( [ <cDevice> ] ) -> lResult


    <cDevice> is optional and is the device to test (LPT2, COM1, etc.).
    If omitted, the function will default to the PRN device.


    .T.  if device is ready for output.
    .F.  if one of the following conditions occurs:
         1)  The device is not ready.
         2)  The device does not exist.
         3)  DOS couldn't open the device for some reason
             (such as no file handles available).


    The Clipper IsPrinter() function is somewhat limited because it only
    works with LPT1.  Furthermore, it talks directly to the hardware, so
    if you have redirected LPT1 via the DOS MODE command, the IsPrinter()
    function will return erroneous results.

    This function offers a better alternative.  Instead of talking to the
    hardware, it issues a DOS call that checks to see if the device is
    ready or not.  That gives DOS an opportunity to deal with any
    redirections, and since you pass the device name as a parameter, you
    can test any device, not just LPT1 (note that the function defaults
    to PRN if you fail to pass a valid parameter).

    The function also temporarily traps the DOS critical error handler so
    you don't get any nasty error messages if the device isn't ready.  It
    restores the old critical error handler before exiting.

    Note that although this function is mainly designed for testing
    printers, you can also check to see if a drive is ready.  Since DOS
    thinks the NUL device exists on every drive, you can pass a drive
    letter followed by NUL as a parameter.  If DOS is able to open the
    NUL device, then the drive is ready, otherwise the door is open or
    something else is wrong.

    The source code is written to adhere to Turbo Assembler's IDEAL mode.
    To use another assembler, you will need to rearrange the PROC and
    SEGMENT directives, and also the ENDP and ENDS directives (a very
    minor task).


       Qout( "PRN is not ready!" )

    IF ! FT_ISPRINT( "COM2" )
       Qout( "Check the device on COM2.  Something is wrong." )

    IF ! FT_ISPRINT( "A:\NUL" )
       Qout( "Oops, better check drive A!" )


 Author: Ted Means


2 responses to “FT_ISPRINT

  1. Pingback: Clipper, NanForum Toolkit, 32-bit virtual OS, Clipper 5.3, CauseWay | Paul's Perambulations

  2. Pingback: FT DOS/BIOS | Viva Clipper !

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.