Previous mail
Next mail
Unformatted/full headers
Overview 10 days
Subject
Date
Thread
Author
From: Eike Lange
Subject: no EOF in untyped files?
Date: 30 Mar 2003, 22:26:34
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
Previous mail
Next mail
Unformatted/full headers
Overview 10 days
Subject
Date
Thread
Author
| Author | Subject | Date |
|---|---|---|
| Frank Heckenbach | no EOF in untyped files? | 31 Mar 2003, 16:35:04 |
Note: This page contains information that does not originate from the owner of this web site, but from the authors of the mails archived. The owner of this web site is not responsible for the content of such information. Any use of that infomation requires the consent of the respective author.
Where WWW addresses (URLs) in the mails archived are marked as hyperlinks, this is only for the comfort of the reader. The content of the web pages linked to like this does not necessarily reflect the opinion of the owner of this web site or of the authors of the mails archived. The owner of this web site is not responsible for the content of such web pages. Those pages are explicitly not to be considered as part of the content of this page, but merely as references.
This page was created by Crystal 0.999 (Linux 2.4.27/i686).