Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!lll-winken!uunet!mcvax!unido!rmi!infoac!infohh!natec From: natec@infohh.rmi.de (NATEC Institut GmbH) Newsgroups: comp.lang.pascal Subject: Re: TurboPascal printer problem... Message-ID: <527@infohh.rmi.de> Date: 15 Apr 89 10:19:59 GMT References: <687@tekno.chalmers.se> Reply-To: natec@infohh.rmi.de (NATEC Institut GmbH) Organization: RMI Net * Aachen/Hamburg/Flensburg * W.Germany Lines: 59 test youtr printer status Procedure PSt ( PrtNo : Byte ); (* Printerstatus *) (* Part of it taken from: *) (* Christoph Naethbohm, CHIP 87(9), 190 *) (* and Klaus Bach, CHIP 88(11), 331 *) Type Bild = Array[1..25,1..80] of Record Ze,At: Char end; Var Inhalt : Bild; Mono_VRam : Bild Absolute $B000:$0000; OrigMode : Word; St : Byte; Weiter : Char; s,p : String; ParStat : Word; Function Bit ( i,j : Byte ) : Boolean; begin if (j>=0) and (j<8) then begin i:= i shl (7-j); i:= i shr 7 end else i:= 0; Bit:= (i=1) end; begin if PrtNo= 0 then p:= 'LPT1: 'else p:= 'LPT2: '; { insert your own status port next line } ParStat:= $379; if MEM[$0FFFF:$0E] = $FE then if PrtNo= 0 then ParStat:= $3BD; { $FE => XT } St:= (Port[ParStat]); Inhalt:= Mono_VRam; OrigMode:= LastMode; CursorOff; MakeWindow (20,12,40,3); while not (Bit(St,7) and Bit(St,6) and Bit(St,4) and not Bit(St,5)) do begin Str (St,s); s:= ' ('+s+')'; if Bit(St,6) and Bit(St,5) and Bit(St,4) and Bit(St,3) then Center(1,p+'Device not connected'+s) else if Bit(St,7) then Center(1,p+'Device switched off'+s) else if Bit(St,5) then Center(1,p+'Paper out'+s) else if not Bit(St,4) then Center(1,p+'Device offline'+s) else Center(1,p+'Device out of order'+s); Center(2,'Any key or (I) for ignore'); Weiter:= ReadKey; if UpCase(Weiter)='I' then St:= 216 else St:= (Port[ParStat]); GotoXY (1,1); ClrEol; end; CursorOn; TextMode(OrigMode); Mono_VRam:= Inhalt end; Dr Gerd C Schmerse | natec@infohh.rmi.de | ___ NATEC Institut | 49 40 88300170 (fax) | /o o\ Hamburg, W.Germany | 49 40 88300124 (voice) | -m-"-U-"-m-