Path: utzoo!attcan!uunet!mcvax!enea!dkuug!freja!damm From: damm@freja.diku.dk (Kristian Damm Jensen) Newsgroups: comp.lang.pascal Subject: Re: DUEL OUTPUT Message-ID: <4492@freja.diku.dk> Date: 1 Mar 89 13:23:33 GMT References: <18461@adm.BRL.MIL> Organization: DIKU, U of Copenhagen, DK Lines: 33 pmancini@lynx.northeastern.edu writes: > I would like to know what is (if possible) standard > implementation in PASCAL to send text output simultaneously > to the screen and to a LST device or file. > writeln('abcdefg12345'); {goes to screen} > writeln(lst,'abcdefg12345'); {goes to printer} > Is there anyway I can send the output to both without > writing the line twice? In programs which print a lot of text > to the screen and the printer it gets very tedious typing everything > over and over again. An easy way to do this would be to make your own write-procedure, something like type string = packed array [1..N] of char; procedure writestring (ToBeWritten : string); begin writeln (ToBeWritten); writeln (lst, ToBeWritten); end; This, however, has the disadvantage that you have to write a procedure for every type you need to write from your program. Are there an easier way to do it (in standard pascal) ? Kristian