<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'EOF trouble' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'EOF trouble' posted on the 'Pascal' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 25 May 2013 00:57:34 -0700</pubDate>
    <lastBuildDate>Sat, 25 May 2013 00:57:34 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>EOF trouble</title>
      <link>http://www.programmersheaven.com/mb/pasprog/287197/287197/eof-trouble/</link>
      <description>I have a code to read a file and write a file on the screen, but on some textfiles it stops to early with writing, and when I later in the progam progress the file it is not completely progressed is there a way to entirely progres the file&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
var fileloc : string;
    textfile : text;
    temp : char;

begin
readln(fileloc);
assign(textfile, fileloc);
reset(textfile);
while not eof(textfile) do
begin
read(textfile, temp);
write(temp)
end;
end.
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/287197/287197/eof-trouble/</guid>
      <pubDate>Mon, 03 Jan 2005 10:51:45 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: EOF trouble</title>
      <link>http://www.programmersheaven.com/mb/pasprog/287197/287285/re-eof-trouble/#287285</link>
      <description>i dont know whether it is related to the problem or not, but&lt;br /&gt;
you have to close the file after processing.&lt;br /&gt;
&lt;br /&gt;
: I have a code to read a file and write a file on the screen, but on some textfiles it stops to early with writing, and when I later in the progam progress the file it is not completely progressed is there a way to entirely progres the file&lt;br /&gt;
: &lt;br /&gt;
: &lt;pre class="sourcecode"&gt;
: var fileloc : string;
:     textfile : text;
:     temp : char;
: 
: begin
: readln(fileloc);
: assign(textfile, fileloc);
: reset(textfile);
: while not eof(textfile) do
: begin
: read(textfile, temp);
: write(temp)
: end;
: end.
: &lt;/pre&gt;&lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/287197/287285/re-eof-trouble/#287285</guid>
      <pubDate>Tue, 04 Jan 2005 06:46:54 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: EOF trouble</title>
      <link>http://www.programmersheaven.com/mb/pasprog/287197/287299/re-eof-trouble/#287299</link>
      <description>: i dont know whether it is related to the problem or not, but&lt;br /&gt;
: you have to close the file after processing.&lt;br /&gt;
: &lt;br /&gt;
: : I have a code to read a file and write a file on the screen, but on some textfiles it stops to early with writing, and when I later in the progam progress the file it is not completely progressed is there a way to entirely progres the file&lt;br /&gt;
: : &lt;br /&gt;
: : &lt;pre class="sourcecode"&gt;
: : var fileloc : string;
: :     textfile : text;
: :     temp : char;
: : 
: : begin
: : readln(fileloc);
: : assign(textfile, fileloc);
: : reset(textfile);
: : while not eof(textfile) do
: : begin
: : read(textfile, temp);
: : write(temp)
: : end;
: : end.
: : &lt;/pre&gt;&lt;br /&gt;
: : &lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
yes i know that i have done it already, this is just a part of the entire code, the problem is not fixed with that.&lt;br /&gt;
the code is to encode and decode files, it only happens with coded files.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/287197/287299/re-eof-trouble/#287299</guid>
      <pubDate>Tue, 04 Jan 2005 08:11:14 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: EOF trouble</title>
      <link>http://www.programmersheaven.com/mb/pasprog/287197/287309/re-eof-trouble/#287309</link>
      <description>: : i dont know whether it is related to the problem or not, but&lt;br /&gt;
: : you have to close the file after processing.&lt;br /&gt;
: : &lt;br /&gt;
: : : I have a code to read a file and write a file on the screen, but on some textfiles it stops to early with writing, and when I later in the progam progress the file it is not completely progressed is there a way to entirely progres the file&lt;br /&gt;
: : : &lt;br /&gt;
: : : &lt;pre class="sourcecode"&gt;
: : : var fileloc : string;
: : :     textfile : text;
: : :     temp : char;
: : : 
: : : begin
: : : readln(fileloc);
: : : assign(textfile, fileloc);
: : : reset(textfile);
: : : while not eof(textfile) do
: : : begin
: : : read(textfile, temp);
: : : write(temp)
: : : end;
: : : end.
: : : &lt;/pre&gt;&lt;br /&gt;
: : : &lt;br /&gt;
: : &lt;br /&gt;
: : &lt;br /&gt;
: yes i know that i have done it already, this is just a part of the entire code, the problem is not fixed with that.&lt;br /&gt;
: the code is to encode and decode files, it only happens with coded files.&lt;br /&gt;
: &lt;br /&gt;
Then the coded files contain the end-of-file symbol before the actual eof. I would suggest an alternate method of loading using a file of char:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
var
  f: file of char;
  ch: char;
  FileLength, i: integer;
begin
  Assign(f, fileloc);
  Reset(f);
  FileLength := FileSize(f);
  for i := 0 to FileLength-1 do
  begin
    read(f, temp);
    write(temp)
  end;
  Close(f);
end;
&lt;/pre&gt;&lt;br /&gt;
This should read the entire file and display it on the screen.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/287197/287309/re-eof-trouble/#287309</guid>
      <pubDate>Tue, 04 Jan 2005 09:19:55 -0700</pubDate>
      <category>Pascal</category>
    </item>
  </channel>
</rss>