Classic Object Pascal for free
Correct way to redirect StdOut .. please?
I cannot get output redirection to work, using...
Assign (Output, '');
Same problem if I change it to ..
Assign (StdOut, '');
WriteLn is used (always) thus ... WriteLn(Output, "whatever");
ie: just WriteLn("whatever"); ..does not work! (when redirecting output)
What is the correct way to redirect StdOut .. please?
Fair enough .. it's Windows XP....
And I want to use standard redirection at the command-line thus...
(AFAIK .. this is pretty standard)..
C:\> MyExe parm1 parm2 > X:\MyOutputfile.txt
So that any WriteLn output goes to MyOutputfile.txt, instead of the screen.
But I wouldn't have thought that it was OS-specific .... or is it?
Surely I'm not the only one using/wanting re-direction .. am I? :-)
Arrgggghhhhh! I forgot .... (It *does* work)...
The "Assign (Output, '')" statement has to be the very *first* statement ... and I was burying it in an initialisation routine - which is why it didn't work at that time.
So... Very sorry ... mea culpa or .. a case of..... RTFM ..! :-))
My apologies to all for what amounts to a "red herring" ...
Please don't hit me :-)