<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'.dat files' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread '.dat files' posted on the 'Pascal' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Wed, 23 May 2012 22:41:03 -0700</pubDate>
    <lastBuildDate>Wed, 23 May 2012 22:41:03 -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>.dat files</title>
      <link>http://www.programmersheaven.com/mb/pasprog/410195/410195/dat-files/</link>
      <description>I have created a *.dat file and I have to find two of the smallest numbers in the file. I have found one of them, but I can't think of how to find the second one. I've tried some things, they are not working.&lt;br /&gt;
Can you help, please? :)&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/410195/410195/dat-files/</guid>
      <pubDate>Wed, 02 Dec 2009 12:17:43 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: .dat files</title>
      <link>http://www.programmersheaven.com/mb/pasprog/410195/410224/re-dat-files/#410224</link>
      <description>It all depends on the layout of your .dat file for one.&lt;br /&gt;
&lt;br /&gt;
If you just mean find the two smallest values and there is one number on each line, you could just have two variables (small_1, small_2) and check each line to see if it's smaller.&lt;br /&gt;
&lt;br /&gt;
if your file looks like this:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
14
3
7
321
25
5
19
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Steps&lt;br /&gt;
1) Set small_1 &amp;amp; small_2 to maximum size (65535 for WORD)&lt;br /&gt;
2) Check for end of file, if eof, goto 7)&lt;br /&gt;
3) Read number (n) from file&lt;br /&gt;
4) if n &amp;lt; small_1, set small_1 to n and goto 2)&lt;br /&gt;
5) if n &amp;lt; small_2, set small_2 to n and goto 2)&lt;br /&gt;
6) goto 2)&lt;br /&gt;
7) show small_1 &amp;amp; small_2&lt;br /&gt;
&lt;br /&gt;
That's it.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/410195/410224/re-dat-files/#410224</guid>
      <pubDate>Wed, 02 Dec 2009 19:29:50 -0700</pubDate>
      <category>Pascal</category>
    </item>
  </channel>
</rss>
