Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!ucscc.ucsc.edu!gorn!filbo
From: filbo@gorn.santa-cruz.ca.us (Bela Lubkin)
Newsgroups: comp.lang.pascal
Subject: Re: printing pascal runs..
Message-ID: <41.filbo@gorn.santa-cruz.ca.us>
Date: 29 Sep 89 04:35:30 GMT
References: <4930@uhccux.uhcc.hawaii.edu>
Organization: R Pentomino
Lines: 32
X-Claimer: I >am< R Pentomino!

In article <4930@uhccux.uhcc.hawaii.edu> "edman" writes:
[how do I redirect Turbo 3.0 program output to the printer?]

  LstOutPtr:=ConOutPtr;

All output goes to the printer, so you better know what the prompts are (or
have an unbuffered dot-matrix printer where you can see what's happening).

And here is a very simple ConOutPtr procedure that sends output to both
devices...

Procedure ConAndLstOutput(C: Char);
  Var
    Regs: Record Case Integer Of
             8: (AL,AH,BL,BH,CL,CH,DL,DH: Byte);
            16: (AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags: Integer);
          End;
  Begin
    With Regs Do
     Begin
      AH:=2;  DL:=Byte(C);  MsDos(Regs);  { Console output }
      AH:=5;  DL:=Byte(C);  MsDos(Regs);  { Printer output }
     End;
  End;

Begin { Main program...}
  ConOutPtr:=Ofs(ConAndListOutput);
  ...

Bela Lubkin     * *   filbo@gorn.santa-cruz.ca.us   CIS: 73047,1112
     @        * *     ...ucbvax!ucscc!gorn!filbo    ^^^  REALLY slow [months]
R Pentomino     *     Filbo @ Pyrzqxgl (408) 476-4633 & XBBS (408) 476-4945