Hi again!

I forgot to mention:

If you want to redirect StdOut (or Output as the variable is called in Pascal) you need to assign a new TextFile to Output (but keep the old one around and assign it back later when your application is terminating).

Example:

var
  oldoutput, f: TextFile;
begin
  AssignFile(f, 'somefile');
  Rewrite(f);
  oldoutput := Output;
  Output := f;
  Writeln('Hello World'); // this is send to Output
  Output := oldoutput;
  CloseFile(f);
end.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to