[fpc-pascal]unix EOF
Michael Van Canneyt
michael.vancanneyt at wisa.be
Thu Jun 6 22:09:26 CEST 2002
On Thu, 6 Jun 2002, Cyril Zlachevsky wrote:
> I try to find correct way finding end of file (EOF) in fpc-program, but
> not have success:
> ---cut ttt.pp---
> var
> f : file of char;
> TmpChar : char;
> begin
> TmpChar:=' ';
> Assign(f,paramstr(1));
> Reset(f);
> while (TmpChar <> #26) do read(f,TmpChar);
On Unix, files are not terminated with CTRL-Z. use
While Not EOF(F) do read (f,TmpChar);
Michael.
More information about the fpc-pascal
mailing list