title: ColdFusion, Trying to parse a tab delimited string
body: <p>I have a short test program to extract strings separated by tabs.  The output does not make sense to me. The idea is to find the next tab position, and return the values in between the previous and next tab.</p>
  
  <p>The output of my program below. Where did the "a rob" come from?</p>
  
  <pre>
      fred     ted    rob a rob   alex
  </pre>
  
  <p><strong>program</strong></p>
  
  <pre><code>&lt;cfscript&gt;
     s="fred"&amp;chr(9)&amp;"ted"&amp;chr(9)&amp;"rob"&amp;chr(9)&amp;"alex";
  
     oldp=0;
     while(oldp&lt;Len(s))
     {
         p=Find(chr(9),s,oldp+1);
         if (p==0)
             break;
         m=Mid(s,oldp+1,p); // oldp is the old tab poit p is the new get string in between
         WriteOutput(m);
         WriteOutput(" ");
         oldp=p;
     }
   &lt;/cfscript&gt;
  </code></pre>
  
  <p>Now if I change the program to print out <code>oldp</code> after each string the result is:</p>
  
  <pre><code>fred =&gt; 1 
  ted rob a =&gt; 6 
  rob alex =&gt; 10
  </code></pre>
  
  <p>I would expect to see <code>1,5,9,</code>. I don't understand why <code>ted rob</code> is the second string. I  would expect to see <code>rob</code> instead.</p>
  
  <p></p>