[comp.lang.pascal] Printer Status in TP

tasos@cs.bu.edu (Anastasios Kotsikonas) (01/15/90)

I was wondering how I could get the printer status (on/off atc.) from within
TP. I would appreciate any help on this and I thank the repliers in advance.

Tasos

Internet: tasos@cs.bu.edu

bseeg@spectra.COM (Bob Seegmiller) (01/16/90)

In article <50540@bu.edu.bu.edu> tasos@cs.bu.edu (Anastasios Kotsikonas) writes:
>
>I was wondering how I could get the printer status (on/off atc.) from within
>TP. I would appreciate any help on this and I thank the repliers in advance.
>
>Tasos
>
>Internet: tasos@cs.bu.edu

Use BIOS INT 17h (printer services).  You'll need a reference manual on
the BIOS and DOS services, and the rest (calling BIOS interrupts) should
be documented in your TP manual.

Best of luck.
-- 
/----------------------------------------+-------------------------------------\
| Bob Seegmiller <The usual disclaimer>  | Spectragraphics Corp.               |
| "Till human voices wake us..." - Eliot | .....................               |
| UUCP: ...!nosc!spectra!bseeg           | Sandy Eggo, CA ......               |

rb@ac.dal.ca (01/16/90)

In article <50540@bu.edu.bu.edu>, tasos@cs.bu.edu (Anastasios Kotsikonas) writes:
> 
> I was wondering how I could get the printer status (on/off atc.) from within
> TP. I would appreciate any help on this and I thank the repliers in advance.
> 
> Tasos
> 
> Internet: tasos@cs.bu.edu

The following function works for me : 

function printer_online : boolean;                 
  var                                              
    regs : registers;                              
  begin                                            
    with regs do                                   
      begin                                        
        al := $00;                                 
        ah := $02;                                 
        dx := $0000;                               
      end;                                         
    intr ($17,regs); { equipment status interrupt }
    if regs.ah = $90 then                          
      printer_online := true                       
    else                                           
      printer_online := false;                     
  end;                                             

This was written using TP4. The predefined registers type is in the DOS unit.

                             Rick Ballard
                             Dalhousie University
                             Halifax, Nova Scotia

tasos@bacardi.bu.edu (Anastasios Kotsikonas) (10/15/90)

Hi,
does anyone have a piece of code to get the printer status (connected/
disconnected) from TP 5.0, that can share with me?

Thanks,
Tasos

tasos@bu-pub.bu.edu

ts@uwasa.fi (Timo Salmi) (10/16/90)

In article <66190@bu.edu.bu.edu> tasos@bacardi.bu.edu (Anastasios Kotsikonas) writes:
>does anyone have a piece of code to get the printer status (connected/
>disconnected) from TP 5.0, that can share with me?

There are two functions for detecting the printer state in the
(/pc/ts/)tspas22.arc Turbo Pascal units collection.  No source
code.  Available by anonymous ftp or mail server from
chyde.uwasa.fi, Vaasa, Finland. 

...................................................................
Prof. Timo Salmi        (Moderating at anon. ftp site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun