<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Which version?' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Which version?' posted on the 'Pascal' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Fri, 24 May 2013 23:07:17 -0700</pubDate>
    <lastBuildDate>Fri, 24 May 2013 23:07:17 -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>Which version?</title>
      <link>http://www.programmersheaven.com/mb/pasprog/429615/429615/which-version/</link>
      <description>I've written three versions of a function which returns the lower case of an upper case alpha char passed to it.  If it is passed a char which is not an upper case alpha it returns the input unmodified.  All three versions have been tested.&lt;br /&gt;
&lt;br /&gt;
Which version do you prefer?  Why?&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
   function    locase(ch : char) : char ;
   {
      case version - jumps to the correct answer and returns
   }
   begin
      case ch of
         'A' : locase := 'a' ;
         'B' : locase := 'b' ;
         'C' : locase := 'c' ;
         'D' : locase := 'd' ;
         'E' : locase := 'e' ;
         'F' : locase := 'f' ;
         'G' : locase := 'g' ;
         'H' : locase := 'h' ;
         'I' : locase := 'i' ;
         'J' : locase := 'j' ;
         'K' : locase := 'k' ;
         'L' : locase := 'l' ;
         'M' : locase := 'm' ;
         'N' : locase := 'n' ;
         'O' : locase := 'o' ;
         'P' : locase := 'p' ;
         'Q' : locase := 'q' ;
         'R' : locase := 'r' ;
         'S' : locase := 's' ;
         'T' : locase := 't' ;
         'U' : locase := 'u' ;
         'V' : locase := 'v' ;
         'W' : locase := 'w' ;
         'X' : locase := 'x' ;
         'Y' : locase := 'y' ;
         'Z' : locase := 'z'

         else
               locase := ch
      end { case }
   end ;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;   function    locase(ch : char) : char ;
   {
      offset version - computes the offset and shifts the char
   }
   CONST
      OFFSET = ord('a') - ord('A') ;
      UPPERS = ['A' .. 'Z'] ;

   begin
      if ch in UPPERS then
         locase := chr(ord(ch) + OFFSET)
      else
         locase := ch
   end ;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;   function    locase(ch : char) : char ;
   {
      search version - searches for the correct char
   }
   var
      c  :  char ;

   begin
      for c := 'a' to 'z' do
         if upcase(c) = ch then begin
            locase := c ;
            exit
         end ;
      {
         if we get to here then ch was not an upper case letter
         so do nothing
      }
      locase := ch
   end ;
&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/429615/429615/which-version/</guid>
      <pubDate>Mon, 24 Sep 2012 00:41:32 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Which version?</title>
      <link>http://www.programmersheaven.com/mb/pasprog/429615/429638/re-which-version/#429638</link>
      <description>All 3 ways seem to be okay; some just taking up more memory than others.  Why not use the &lt;span style="color: Green;"&gt;&lt;strong&gt;lowercase&lt;/strong&gt;&lt;/span&gt; function that is in the &lt;span style="color: Purple;"&gt;&lt;strong&gt;System&lt;/strong&gt;&lt;/span&gt; unit of Free Pascal 2.6.0?&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/429615/429638/re-which-version/#429638</guid>
      <pubDate>Tue, 25 Sep 2012 21:34:24 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Which version?</title>
      <link>http://www.programmersheaven.com/mb/pasprog/429615/429639/re-which-version/#429639</link>
      <description>: All 3 ways seem to be okay; some just taking up more memory than &lt;br /&gt;
: others.  Why not use the &lt;span style="color: Green;"&gt;&lt;strong&gt;lowercase&lt;/strong&gt;&lt;/span&gt; &lt;br /&gt;
: function that is in the &lt;span style="color: Purple;"&gt;&lt;strong&gt;System&lt;/strong&gt;&lt;/span&gt; unit of &lt;br /&gt;
: Free Pascal 2.6.0?&lt;br /&gt;
: &lt;br /&gt;
I'm not using Free Pascal.  I'm using Turbo Pascal 7.0&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/429615/429639/re-which-version/#429639</guid>
      <pubDate>Wed, 26 Sep 2012 14:30:32 -0700</pubDate>
      <category>Pascal</category>
    </item>
  </channel>
</rss>