home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TPTOOL4.ZIP / PRNSTAT.INC < prev    next >
Encoding:
Text File  |  1987-03-28  |  702 b   |  32 lines

  1.  
  2. #log Printer status predicate
  3.  
  4. (* prnstat - check printer status *)
  5.  
  6. type
  7.    prn_states =
  8.       (unplugged, power_off, ready, offline, offline_pending, online_busy);
  9.  
  10.  
  11. function prn_status: prn_states;
  12. const
  13.    printer_port = $3bd;  {printer 0 status register}
  14. var
  15.    data: integer;
  16.  
  17. begin
  18.    data := port[printer_port];
  19.    case data of
  20.       $7f: prn_status := unplugged;
  21.       $f7: prn_status := power_off;
  22.       $df: prn_status := ready;
  23.       $4f: prn_status := offline;
  24.       $cf: prn_status := offline_pending;
  25.       $5f: prn_status := online_busy;
  26.  
  27.       else {writeln(' prn_status: unknown printer status: ',data);}
  28.            prn_status := ready;
  29.    end;
  30. end;
  31.  
  32.