Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8899855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:57:35+00:00 2026-06-15T00:57:35+00:00

Mason Wheeler wrote a very nice procedure to compare string lists, but I do

  • 0

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?

 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); <- [DCC Error] Unit1.pas(1336): E2010 Incompatible types: 'TStringCompareProc' and 'procedure, untyped pointer or untyped parameter'
    end;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:57:36+00:00Added an answer on June 15, 2026 at 12:57 am

    You should only write List1Proc and List2Proc as arguments of StringListCompare. That is, write

    iFinalStringList := StringListCompare(iNewFilesStringList,
      iExistingFilesStringList, nil, nil, List1Proc, List2Proc, False);
    

    instead of

    iFinalStringList := StringListCompare(iNewFilesStringList,
      iExistingFilesStringList, nil, nil, List1Proc(iValue, @iData),
      List2Proc(iValue, @iData), False);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this code works fine: procedure TForm2.Timer1Timer(Sender: TObject); var Text: string; begin SetLength (Text,555); GetWindowText
I despise the PHP language, and I'm quite certain that I'm not alone. But
I'm writing a small web application using Perl, HTML::Mason and Apache. I've been using
Seems like my data is getting corrupted when using HTTPapp.HTMLEncode( string ): String; HTMLEncode(
In some project ( Mason ) there is a lot of perl modules (>
I'm trying to use Apache::Session::Memcached in an HTML::Mason project where I'm using MasonX::Request::WithApacheSession to
Greetings, I'm trying to develop some tests for Mason components which requires running them
I am using free-text on my website to get better search results but am
Not sure the most effient way to do this. Bash seems the easiest, I
I am using mod_perl 2, mason, and apache 2.2 on Ubuntu 10.10 (x86) (standard

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.