Re: Printer Checks via In

 BBS: Inland Empire Archive
Date: 03-28-92 (16:46)             Number: 187
From: BOB PERKINS                  Refer#: 136
  To: MIKE PHILLIPS                 Recvd: NO  
Subj: Re: Printer Checks via In      Conf: (2) Quik_Bas
 MP>   Hey, can you use interrupts to check the printer status in QuickBASIC
 MP> 4.5?  I saw this little jewel in the C Echo.  Seems like I remember
 MP> interrupts from the QBNews (gotta look in my folder).  Anyone have code?

  I'm not sure if you can use DOS' IOCTL on a printer.  I'm
interested in seeing if someone else can post code to do
so.  In the meantime, perhaps the code below will get you
going.  DX is loaded with the printer port you wish to
check (0-3).

  '$INCLUDE: ''
  DIM regs AS RegType = &H200
  regs.dx = &H0
  CALL INTERRUPT(&H17, regs, regs)
  t% = ( \ 256) AND 255
  IF t% AND 64 THEN
    PRINT "Printer didn't respond."
    PRINT "Printer responded."
  IF t% AND 128 THEN
    PRINT "Printer is not busy."
    PRINT "Printer is busy."
  IF t% AND 32 THEN
    PRINT "Printer is out of paper."
    PRINT "Printer is loaded with paper."

--- Msg V4.5
 * Origin: Reciprocity Failure  (1:124/4115.236)
Outer Court
Echo Basic Postings

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