Path: utzoo!attcan!uunet!ginosko!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!bloom-beacon!eru!luth!sunic!tut!ra!chyde!ts From: ts@chyde.uwasa.fi (Timo Salmi LASK) Newsgroups: comp.lang.pascal Subject: Re: printing pascal runs.. Message-ID: <809@chyde.uwasa.fi> Date: 30 Sep 89 13:24:09 GMT References: <4930@uhccux.uhcc.hawaii.edu> <41.filbo@gorn.santa-cruz.ca.us> Reply-To: ts@chyde.uwasa.fi (Timo Salmi LASK) Organization: U of Vaasa, Finland Lines: 28 In article <41.filbo@gorn.santa-cruz.ca.us> filbo@gorn.santa-cruz.ca.us (Bela Lubkin) writes: >In article <4930@uhccux.uhcc.hawaii.edu> "edman" writes: >[how do I redirect Turbo 3.0 program output to the printer?] > > LstOutPtr:=ConOutPtr; This is indeed a very neat solution to the problem in Turbo Pascal 3. I must admit that I did not come to think of it myself. Just in case it confuses somebody, allow a minor correction. It should be the other way round, that is ConOutPtr := LstOutPtr; What happens here is that the pointers to the i/o drivers can be changed in Turbo Pascal 3 using this method. It takes effect when the statement is first encountered. So for some applications it might be even placed elsewhere than at the beginning of the program. In fact, this redirection can be turned on and off by storing the pointer to the i/o routine like this: var tmp : integer; : tmp := ConOutPtr; (* store the original *) ConOutPtr := LstOutPtr; (* redirect *) : : ConOutPtr := tmp; (* again to screen *) : ................................................................... Prof. Timo Salmi (Site 128.214.12.3) School of Business Studies, University of Vaasa, SF-65101, Finland Internet: ts@chyde.uwasa.fi Funet: vakk::salmi Bitnet: salmi@finfun