On Wed, Dec 27, 2023 at 3:25 AM James Richters wrote: > I wanted to write what I thought should be a simple procedure, just instead > of calling WRITELN() with some arguments, call WRITELOG() with the same > arguments that you would use to write to a file, but my WRITELOG() procedure > would write to the screen and the file.. but I can’t figure out how to pass > all > the arguments to the two WRTIELNs.
Essentially you want to emulate what the "tee" command does but internal to your program. You can intercept data written to STDOUT and copy the data to your desired destination(s) (i.e. to console and file). See message thread "redirecting stdout" here: https://lists.freepascal.org/pipermail/fpc-pascal/2010-July/thread.html#26149 Also redirecting stdout to a Stream / TMemo: https://forum.lazarus.freepascal.org/index.php/topic,34621.0.html _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal