Answer the question
In order to leave comments, you need to log in
How to output data to STDERR stream from Turbo Pascal 7.0/7.1 program?
In Turbo Pascal, two standard streams are available to the program: <STDIN> in a variable of type text Input and <STDOUT> in Output .
Please tell me how to open the <STDERR> error stream for writing using standard language tools (even with crutches, for example, assembler inserts, interrupts, DOS and BIOS function calls).
Answer the question
In order to leave comments, you need to log in
I haven't picked up Turbo Pascal for a long time, about 15 years :)
Try something like this:
program Demo;
uses
Dos;
var
StdErr: Text;
begin
Assign(StdErr, '');
Rewrite(StdErr);
TextRec(StdErr).Handle:=2;
Writeln('Standard output');
Writeln(StdErr, 'Standard error');
Close(StdErr);
end.
Also, look at the sources of the Dos module (like Turbo Pascal should also be the source of standard modules) - maybe there already is a variable like ErrOutput
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question