Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Tom Rettigs Library - isprinter() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ISPRINTER()
 Evaluates whether the active printer is ready to accept output.
 Returns <expL> true if printer is on-line and ready, otherwise false.

 Checks output device address associated with LPT1.

 @...SAY "Ready the printer, and press any key to begin..."
 DO WHILE .NOT. ISPRINTER()
    @...SAY "The printer is not on-line and ready"
    @...SAY "Ready the printer or press Escape to cancel"
    keypress = INKEY(0)
    IF keypress = 27 .OR. keypress = 0
       RETURN    && Escape key or if time runs out
    ENDIF
 ENDDO
 @...    && clear the above prompts
 @...SAY "Printing, please do not disturb"
 <output to printer>

 Hazard
    Checks only parallel printers.  Serial printers using
    redirected output with the DOS MODE command are not
    checked, nor are software print buffers.

    Wherever possible, library routines use DOS function calls
    (int 21h) for maximum portability between various computers.
    But, for the library to perform an operation where that
    facility is not available from DOS, we had to use a direct ROM
    BIOS interrupt.  These may not work properly (or at all) on
    some computers.  Test this function on the target hardware
    before relying on their use in your application.


             Placed in the Public Domain by Tom Rettig Assoc.

See Also: LPTSWAP PRNSTATUS()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson