title: delphi compare text file contents
body: <p>We need to compare the contents of two (or more) text files to determine if we need to create a backup. If they differ we create a new backup.</p>
  
  <p>I currently use the CRC value of each file to check for differences but I was wondering if there is a more efficient or elegant way of detecting differences between to files.</p>
  
  <pre><code>//Use madZIP to calculate the CRC fior this file
  GetUncompressedFileInfo(Filename_1, Size_1, NewCRC);
  
  //Use madZIP to calculate the CRC fior this file
  GetUncompressedFileInfo(Filename_2, Size_2, OldCRC);
  
  //if ThisFileHash = ExistingFileHash then
  if (OldCRC &lt;&gt; NewCRC) then
    CreateABackup;
  </code></pre>
  
  <p>Regards, Pieter.</p>