[fpc-pascal] eof strangeness

Bob Richards bob at tamara-b.org
Tue May 2 20:42:00 CEST 2006

John Coppens wrote:

> program testeof;
> begin
>   if eof then
>     writeln('EOF found')
>   else
>     writeln('No EOF found');
> end.
> This sample program doesn't return till <enter> is pressed.

That's correct and reasonable. You are terminating your program after an EOL (ENTER), If
you send it an EOF ^d it also responds reasonably.

$ ./testeof
       ^d entered at kybd
EOF found


PGP Encrypted E-Mail Prefered
Public Key at: http://www.tamara-b.org/~bob/pubkey.asc

More information about the fpc-pascal mailing list