Language:
Русский
English
{Flush.PAS}
▀▀▀▀▀▀▀▀▀▀▀▀▀
{Sample code for the Flush procedure.}
uses WinDos, WinCrt;
procedure ReportError(s : String);
{ Redirect output to the DOS standard
error handle and emit an error message,
then halt.
The file "output" must be flushed before
its handle is changed, or some earlier
output may appear with the error
message.}
begin
Flush(output); { Must flush current output}
{ Redirect output to standard error handle}
TTextRec(output).handle := 2;
Writeln(s);
Halt(1);
end;
begin
ReportError('An error occurred');
end.