Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!orc!inews!iwarp.intel.com!csun!Twg-S5!abcscnuk From: abcscnuk@Twg-S5.uucp (Naoto Kimura (ACM)) Newsgroups: comp.lang.pascal Subject: Re: Turbo Pascal and HP fonts Keywords: drop-in replacement for printer unit... Message-ID: <1990Sep12.054434.12554@csun.edu> Date: 12 Sep 90 05:44:34 GMT References: <33771@cup.portal.com> <5800@vice.ICO.TEK.COM> Sender: news@csun.edu (News Administrator) Organization: csun Lines: 87 Here's something I hacked some time ago.... I've used this quite a few times without trouble... ---- cut here -------- cut here -------- cut here -------- cut here ---- unit Lpr; (*====================================================================*\ || MODULE NAME: Lpr || || DEPENDENCIES: System.TPU, Dos.TPU || || LAST MOD ON: 8904.05 || || PROGRAMMER: Naoto Kimura || || || || DESCRIPTION: This unit declares a file variable "lst" that || || corresponds to the printer device. This unit does || || not have the same bug (inability to print ^Z) that || || the "printer" unit provided with the compiler. || \*====================================================================*) interface uses Dos; var lst : text; implementation {$F+} function LPRout( var f : TextRec ) : integer; var P : word; regs : registers; begin with f do begin P := 0; while P < BufPos do begin regs.AH := $05; regs.DL := byte(BufPtr^[P]); msdos(regs); inc(P) end; BufPos := 0 end; LPRout := 0 end; function LPRignore( var F : TextRec ) : integer; begin LPRignore := 0 end; function LPRopen( var F : TextRec ) : integer; begin with f do begin Mode := fmOutput; InOutFunc := @LPRout; FlushFunc := @LPRout; CloseFunc := @LPRignore end; LPRopen := 0 end; procedure AssignLPR( var F : text ); begin with TextRec(F) do begin Handle := $FFFF; Mode := fmClosed; BufSize := sizeof(Buffer); BufPtr := @Buffer; OpenFunc := @LPRopen; Name[0] := #0 end end; {$F-} begin AssignLPR(lst); rewrite(lst) end. ---- cut here -------- cut here -------- cut here -------- cut here ---- //-n-\\ Naoto Kimura _____---=======---_____ (abcscnuk@csuna.csun.edu) ====____\ /.. ..\ /____==== // ---\__O__/--- \\ Enterprise... Surrender or we'll \_\ /_/ send back your *&^$% tribbles !!