<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Remembering Telephone Numbers</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2004/05/13/remembering-telephone-numbers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2004/05/13/remembering-telephone-numbers/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Wed, 08 Feb 2012 23:58:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Dick</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/05/13/remembering-telephone-numbers/#comment-1508</link>
		<dc:creator>Dick</dc:creator>
		<pubDate>Fri, 14 May 2004 15:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=542#comment-1508</guid>
		<description>&lt;p&gt;Mike:  I agree about big nested loops.  When I know the number of loops (4 in this case), I&#039;m too lazy to use recursion.  I like what you&#039;ve done though, you just need to add a CheckSpelling line.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Mike:  I agree about big nested loops.  When I know the number of loops (4 in this case), I&#8217;m too lazy to use recursion.  I like what you&#8217;ve done though, you just need to add a CheckSpelling line.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Woodhouse</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/05/13/remembering-telephone-numbers/#comment-1507</link>
		<dc:creator>Mike Woodhouse</dc:creator>
		<pubDate>Fri, 14 May 2004 12:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=542#comment-1507</guid>
		<description>&lt;p&gt;Uurrrgh. I hates big nested loops, I hates &#039;em. This looked like it was screaming for recursion, so I tried it (below). The code&#039;s not as expressive as I would ideally like, but it&#039;ll do for now.&lt;/p&gt;
&lt;p&gt; Option Explicit&lt;/p&gt;
&lt;p&gt; Private words As Collection&lt;br&gt;
 Private letters As Variant&lt;br&gt;
 Private numbers As Variant&lt;br&gt;
 Private lettersNeeded As Long&lt;/p&gt;
&lt;p&gt; Public Sub WordsFromPhoneNumber(inputNumber As String)&lt;/p&gt;
&lt;p&gt;   Dim index As Long&lt;br&gt;
   Dim word As Variant&lt;/p&gt;
&lt;p&gt;    &#039; from 0 to 9 on my Nokia mobile:&lt;br&gt;
    letters = Array(&quot;0?, &quot;1?, &quot;abc&quot;, &quot;def&quot;, &quot;ghi&quot;, &quot;jkl&quot;, &quot;mno&quot;, &quot;pqrs&quot;, &quot;tuv&quot;, &quot;wxyz&quot;)&lt;/p&gt;
&lt;p&gt;    ReDim numbers(1 To Len(inputNumber))&lt;/p&gt;
&lt;p&gt;    lettersNeeded = Len(inputNumber)&lt;/p&gt;
&lt;p&gt;    For index = 1 To lettersNeeded&lt;br&gt;
        numbers(index) = CInt(Mid(inputNumber, index, 1))&lt;br&gt;
    Next&lt;/p&gt;
&lt;p&gt;    Set words = New Collection&lt;/p&gt;
&lt;p&gt;    BuildWords &quot;&quot;, 1&lt;/p&gt;
&lt;p&gt;    For Each word In words&lt;br&gt;
        Debug.Print word&lt;br&gt;
    Next&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Private Sub BuildWords(wordSoFar, numberIndex)&lt;/p&gt;
&lt;p&gt;Dim letterIndex As Long&lt;br&gt;
Dim nextLetter As String&lt;br&gt;
Dim nextWord As String&lt;/p&gt;
&lt;p&gt;    For letterIndex = 1 To Len(letters(numbers(numberIndex)))&lt;/p&gt;
&lt;p&gt;        nextLetter = Mid(letters(numbers(numberIndex)), letterIndex, 1)&lt;br&gt;
        nextWord = wordSoFar &amp; nextLetter&lt;/p&gt;
&lt;p&gt;        If numberIndex &lt; lettersNeeded Then&lt;br&gt;
            BuildWords nextWord, numberIndex + 1&lt;br&gt;
        Else&lt;br&gt;
            words.Add nextWord&lt;br&gt;
        End If&lt;br&gt;
    Next&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Uurrrgh. I hates big nested loops, I hates &#8216;em. This looked like it was screaming for recursion, so I tried it (below). The code&#8217;s not as expressive as I would ideally like, but it&#8217;ll do for now.</p>
<p> Option Explicit</p>
<p> Private words As Collection<br />
 Private letters As Variant<br />
 Private numbers As Variant<br />
 Private lettersNeeded As Long</p>
<p> Public Sub WordsFromPhoneNumber(inputNumber As String)</p>
<p>   Dim index As Long<br />
   Dim word As Variant</p>
<p>    &#8216; from 0 to 9 on my Nokia mobile:<br />
    letters = Array(&#8220;0?, &#8220;1?, &#8220;abc&#8221;, &#8220;def&#8221;, &#8220;ghi&#8221;, &#8220;jkl&#8221;, &#8220;mno&#8221;, &#8220;pqrs&#8221;, &#8220;tuv&#8221;, &#8220;wxyz&#8221;)</p>
<p>    ReDim numbers(1 To Len(inputNumber))</p>
<p>    lettersNeeded = Len(inputNumber)</p>
<p>    For index = 1 To lettersNeeded<br />
        numbers(index) = CInt(Mid(inputNumber, index, 1))<br />
    Next</p>
<p>    Set words = New Collection</p>
<p>    BuildWords &#8220;&#8221;, 1</p>
<p>    For Each word In words<br />
        Debug.Print word<br />
    Next</p>
<p>End Sub</p>
<p>Private Sub BuildWords(wordSoFar, numberIndex)</p>
<p>Dim letterIndex As Long<br />
Dim nextLetter As String<br />
Dim nextWord As String</p>
<p>    For letterIndex = 1 To Len(letters(numbers(numberIndex)))</p>
<p>        nextLetter = Mid(letters(numbers(numberIndex)), letterIndex, 1)<br />
        nextWord = wordSoFar &amp; nextLetter</p>
<p>        If numberIndex &lt; lettersNeeded Then<br />
            BuildWords nextWord, numberIndex + 1<br />
        Else<br />
            words.Add nextWord<br />
        End If<br />
    Next</p>
<p>End Sub</p>
]]></content:encoded>
	</item>
</channel>
</rss>

