home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 15 / CD_ASCQ_15_070894.iso / vrac / dnalib7a.zip / PRINTER.BAS < prev    next >
BASIC Source File  |  1994-05-14  |  659b  |  18 lines

  1. FUNCTION Printer%(Port%)PUBLIC
  2.  
  3. $CODE SEG "DNASEG2"
  4.  
  5. LOCAL Status%
  6.  
  7. REG 1, &H0200                           ' set AH to 2
  8. REG 4, Port%                            ' set DX to the parallel port number
  9. CALL INTERRUPT &H17                     ' call BIOS interrupt 17h
  10. Status% = REG(1) \ 256                  ' Status% is a byte read from AH
  11.  
  12. IF (Status% AND &B00000001) THEN Printer% = 1  ' printer has timed out
  13. IF (Status% AND &B00001000) THEN Printer% = 2  ' printer has had an I/O error
  14. IF (Status% AND &B00100000) THEN Printer% = 3  ' printer is out of paper
  15. IF (Status% AND &B10000000) = 0 THEN Printer% = 4  ' printer is OK
  16.  
  17. END FUNCTION
  18.