I've created an improved "more" command in Rexx, but
have been unable to use redirection or pipes because,
once the redirection is complete, I'm unable to reset
or flush STDIN. Without this, I'm unable to process
command input because Rexx thinks there's already
content in STDIN. Details:
1. Run a command like rexx more < infile.txt, where
"more" is my more.rexx program.
2. Inside more.rexx, I say,
do while lines(stdin)
3. The above works, but then later, when I run,
parse pull userinput
I get an infinite loop with the parse pull returning a
null string "".
4. Further investigation: when I run,
say stream(stdin, 'Command', "FLUSH")
say stream(stdin, 'Command', 'QUERY POSITION READ')
24772 (which is the #lines in original input file).
I'm not sure if this is a bug or an incomplete feature
in Regina, and/or a miswart in Windows (happens in both
98 and XP). This DOES work for the Windows more
command, which handles redirection/pipes and in XP has
a small command interpreter within it (show line
numbers, skip n lines, etc.)