title: How To Fix Incompatible Type
body: <p>Mason Wheeler wrote a very nice procedure to compare string lists, but I do not understand how to write the callback procedures TStringCompareProc.  Can some one help me get this to compile?</p>
  
  <pre><code> type
       TStringCompareProc = procedure(const value: string; const data: TObject) of object;
       procedure StringListCompare(List1, List2: TStringList; matchProc: TStringEqualProc;
                                    list1Proc, list2Proc: TStringCompareProc; presorted: boolean = false);
  
      Usage:
  
      procedure TForm1.MatchProc(const value: string; const data: TObject);
      // match is found between the two lists
      begin
      //
      end;
  
      procedure TForm1.List1Proc(const value: string; const data: TObject);
      // when the first list contains a string not in the second list
      begin
      //
      end;
  
      procedure TForm1.List2Proc(const value: string; const data: TObject);
      // when the second list contains a string not in the first list
      begin
      //
      end;
  
      procedure TForm1.Compare1Click(Sender: TObject);
      var
      MatchProc: TStringEqualProc;
      List1Proc: TStringCompareProc;
      List2Proc: TStringCompareProc;
      iValue: string;
      iData: ^PString;
      begin
      iFinalStringList := StringListCompare(iNewFilesStringList, iExistingFilesStringList,
                nil, nil, List1Proc(iValue, @iData), List2Proc(iValue, @iData), False); &lt;- [DCC Error] Unit1.pas(1336): E2010 Incompatible types: 'TStringCompareProc' and 'procedure, untyped pointer or untyped parameter'
      end;
  </code></pre>