ts> However, I still want to _understand_ why the program behaves the way
ts> it does. By the way, I am not (usually) programming in either Pascal
ts> or Windows (which is no doubt painfully obvious already). So I don't
ts> und how buffering input screws-up the output. I suppose that IS my
ts> questi
ts> But, even with a valid EOF for INPUT, VAX Pascal exhibits (apparently)
ts> strange behavior on these loops.
ts> Can anybody clue me in on what's happening here?
I believe what it happens is:
DEC's pascal reads from the console itself. I am sure if you wrote a program
that displays two lines of text, you could pipe it:
textprog > output.txt
However, using writeln, you _cannot_ pipe it two a file.
It (turbo pascal) doesn't do it that way. however, if you assign the console
to a file, I believe it'll work like you want it to:
program readfromconsole;
var
console:text;
inputtext:string;
begin
assign(console,'');
rewrite(console);
while not eof(console) do
readln(console,inputtext);
writeln(console,'this can be piped into a file!');
close(console);
end.
this method also works if you want to use the ansi driver to display ansi
codes.
the maverick - m...@microserve.net - http://xf.home.ml.org
... The word 'meaningful' when used today is nearly always meaningless.