BBS: Inland Empire Archive Date: 03-19-92 (16:05) Number: 182 From: MICHAEL MALLEY Refer#: NONE To: TOM ROLLINS Recvd: NO Subj: interrupst Conf: (2) Quik_Bas
TR>Does anyone have a routine that uses dos to see whether at
TR>printer is connected and checks whether it is online or
TR>not? I would appreciate seeing the code if you have an
Regs.ax = &H200
Regs.dx = (0 - 2 for LPT1 - LPT3)
CALL Interrupt(&H17, Regs, Regs)
'Regs.ax returns the printer status in AH.
AH% = Regs.ax \ 256
7 6 5 4 3 2 1 0
1 Timeout
x x Unused
1 I/O error
1 Printer selected
1 Out of paper
1 Acknowledged
1 Printer not busy
If you're using a Personal Computer AT, a PC XT 286, or a PS/2, and the
printer is busy, it will execute Int 15H function 90H, which is a device
wait. My guess is that it will wait for a while to get ahold of the
printer. But if you're printing something, the best thing to do is to
trap the error through BASIC, because someone can always reach over and
turn off the printer resulting in a crashed program.
* SLMR 2.1a * My compiler has a first name, it's Q.U.I.C.K.
--- Maximus 2.01wb
* Origin: UltraTech - Nashville, TN (615) 356-0453 {HST} (1:116/30)

Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET