title: Convert C++ FOR loop to Delphi
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/9986346/converting-c-for-loop-to-delphi">Converting C &ldquo;FOR&rdquo; loop to Delphi</a>  </p>
  </blockquote>
  
  
  
  <p>I'm trying to convert a C++ FOR loop to Delphi, but I have no idea how to do it...</p>
  
  <p>this is the C++ function:</p>
  
  <pre><code>bool bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
  {
      for(;*szMask;++szMask,++pData,++bMask)
          if(*szMask=='x' &amp;&amp; *pData!=*bMask)   return 0;
      return (*szMask) == NULL;
  }
  </code></pre>
  
  <p>I just got convert the function declaration:</p>
  
  <pre><code>function bCOmpare( pData: PBYTE; bMask: PBYTE; szMask: PCHAR):boolean;
  begin
  //...
  end;
  </code></pre>
  
  <p>How is the conversion?</p>
  
  <p>Thanks</p>