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 - call lptswap http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 CALL LPTSWAP
 Switches output between two printers.

 Swaps the device address associated with LPT1 with the device address
 associated with LPT2.  Printer output goes to the device address
 associated with LPT1.

 Assumes one printer is connected to LPT1 and another to LPT2.

 See your DOS documentation or The Peter Norton Programmer's Guide
 to the IBM-PC for more information on devices.

 SET DEVICE TO PRINTER
 * output is directed to printer 1 by default
 @...SAY . . .
 CALL LPTSWAP    && output to printer 2
 @...SAY . . .
 CALL LPTSWAP    && output to printer 1
 @...SAY . . .
 CALL LPTSWAP    && output to printer 2
 @...SAY . . .
 SET DEVICE TO SCREEN
 CALL LPTSWAP    && restore to 1 before exiting
 RETURN    && or QUIT

 Hazard
    Because LPTSWAP takes no parameters, it is impossible to
    tell by reading the code which printer is "active" unless you
    comment your code as in the above example.

    DOS does not restore the device address for you.  The active
    printer when you leave your program will remain the active
    printer in DOS.


             Placed in the Public Domain by Tom Rettig Assoc.

See Also: ISPRINTER() PRNSTATUS()

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