Article View: comp.os.msdos.programmer
Article #808Re: Printer off-line
From: Stan Brown
Date: Thu, 16 Apr 1992 21:33
Date: Thu, 16 Apr 1992 21:33
26 lines
1580 bytes
1580 bytes
In article <1992Apr15.151328.5678@bradford.ac.uk> N.J.Watts@bradford.ac.uk (NJ WATTS) writes:
>Dear all,
> Is it possible to determine whether or not a printer on the stdprn
>stream is on-line or not before sending any information to it? I cannot
>get around the problem that the operating system cuts in whenever the printer
>is off-line and leaves an unsightly message in the middle of my applications.
You don't mention which programming language you're using, so I'll stick
to the general solution: INT 17 function 02; see Ralf Brown's interrupt
list or other BIOS references.
Oh what the heck, it's not long:
mov ah,2
mov dx,0 (0=LPT1, 1=LPT2, 2=LPT3)
int 17h
Status comes back in AH. You want bit 4 (selected) to be a 1 and the
following to be 0: bit 5 (out of paper), 3 (I/O error), 0 (timeout).
--
Stan Brown, Oak Road Systems, Cleveland, Ohio, USA brown@ncoast.org
"But this information is only being given on a need-to-know basis."
"I need to know _everything._ How else can I know whether I need to
know it?" -- quoted from memory from {Yes, Prime Minister}
Technical Details
Message-ID:
<1992Apr16.213312.22909@NCoast.ORG>Path:
arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!agate!usenet.ins.cwru.edu!ncoast!brownReferences:
<1992Apr15.151328.5678@bradford.ac.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!agate!usenet.ins.cwru.edu!ncoast!brown From: brown@NCoast.ORG (Stan Brown) Newsgroups: comp.os.msdos.programmer Subject: Re: Printer off-line Message-ID: <1992Apr16.213312.22909@NCoast.ORG> Date: 16 Apr 92 21:33:12 GMT Article-I.D.: NCoast.1992Apr16.213312.22909 References: <1992Apr15.151328.5678@bradford.ac.uk> Organization: Oak Road Systems, Cleveland Ohio USA Lines: 26