Archived

This topic is now archived and is closed to further replies.

Fella

Pascal problem

Recommended Posts

program blabla; var x: integer; begin while not eof do read(x); write(x) end. When eof becomes TRUE the program will stop reading. But in this case it never stops. My question is: how do I make eof become TRUE? I am usingTurbo Pascal 7.0

Share this post


Link to post
Share on other sites
You haven''t specified a file, hence there is no end.


program blabla;

var x: integer;
f:text;
begin
assign(f,''filename'');
reset(f);
while not eof(f) do
begin
read(x);
write(x)
end;
close(f);
end.



This post qualifies for 100 per cent Canadian Content under the rulings of the Canadian Internet Commission and the Federal Ministry of Communication. There are four Americans who worked on this post, but they all have landed immigrant status, and have signed CRTC affidavits swearing that they drink beer, eat back bacon, drive snowmobiles and wear toques. Any resemblance between the Content of this post and the content of any American post is purely coincidental and not the intention of the poster or the various Internet Agencies of the Canadian Government who have screened these posts prior to bulk erasing in accordance with the policies of the Federal Internet Identity Board.

Share this post


Link to post
Share on other sites