Hi Folks!
I've problems in one of my programs using
untyped files. EOF does not work as expected:
program Foo;
var
f: File;
i, v: Integer;
begin
Assign (f, 'foo.dat');
Rewrite (f, SizeOf (Integer));
v := 101;
for i := 0 to 10 do
BlockWrite (f, v, 1);
Close (f);
Reset (f, SizeOf (Integer));
while not EOF (f) do
begin
BlockRead (f, v, 1);
WriteLn (v)
end;
Close (f)
end.
The output is _not_ 11 times 101 as expected but
six lines garbage. Replacing the while-loop with
a for-loop (0 to 10), all works fine.
What do I wrong?
I'm using gpc 20030323 with gcc 3.2.2
Eike