G'day Folks,
Correct way to redirect StdOut .. please?
...Because...
I cannot get output redirection to work, using...
Assign (Output, '');
Rewrite(Output);
Same problem if I change it to ..
Assign (StdOut, '');
Rewrite(StdOut);
..Unless....
WriteLn is used (always) thus ... WriteLn(Output, "whatever");
ie: just WriteLn("whatever"); ..does not work! (when redirecting output)
Soooooo...
What is the correct way to redirect StdOut .. please?
Many Thanks
Barry
Tags:
Views: 435
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? :-)
Cheers
Barry
G'day Folks
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 :-)
Cheers
Barry
© 2022 Created by Allan Mertner.
Powered by