Date : Fri, 25 Jan 1985 00:01:50 GMT
From : James Hunter <hunterj%utai.uucp@BRL-TGR.ARPA>
Subject: Re: Turbo Pascal output
In article <864@ihuxk.UUCP> db21@ihuxk.UUCP (Dave Beyerl) writes:
>
>> Subject: Turbo Pascal output
>>
>> Is there a method that enables program output to be sent
>> to the screen and printer??? Cntrl-P works when running
>> CPM, but from Turbo Pascal, it doesn't. (at least not on
>> my machine.) Do I make the program a .COM file and use Cntrl-P??
>> Thanks in advance for any help given.
>>
> In order to print output to both the screen and the line
>printer in Turbo Pascal under CP/M you must include a second
>writeln statement which directs its output to the Lst device.
>For example, to print the string 'Hello There!' on both the
>screen and printer, you would include the following lines in
>your program:
>
> writeln ('Hello There!'); { print on screen }
> writeln (Lst,'Hello There!'); { print on printer }
>
Or, you could write a procedure to print to both the console and the printer:
type
workstring = string[255];
procedure both(stuff: workstring);
begin
writeln(stuff);
writeln(LST,stuff);
end;
You may want to use the compiler directive {$V-} with this which relaxes
parameter checking and allows parameters of any string length to be passed.
{See section 16.1.1 of manual about this}.
The problem with this approach is that you may want to print both strings
and numbers, which won't be automatically formatted as with the writeln
command.
Gumby lives!!