Solved

Descendant of TList

Posted on 1999-01-21
3
398 Views
Last Modified: 2013-11-23
Hi all,

In one of my Apps, I use a class that is a descendant of TList. So, how can I call a procedure everytime the count property of my class has changed?

regards
rene
0
Comment
Question by:rene100
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 100 total points
ID: 1362745
Override the add/delete/remove methods and call your procedure from those overridden methods.

eg:
// in class declaration
  procedure Add(Item : Pointer); Override;

// in main body
  procedure Add(Item : Pointer);
  begin
    Inherited Add(Item);
    DoMyThing;
  end;


0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1362746
Oops, there are a couple of problems:

eg:
    // in class declaration
      procedure Add(Item : Pointer);

    // in main body
      procedure TMyList.Add(Item : Pointer);
      begin
        Inherited Add(Item);
        DoMyThing;
      end;

Cheers,

Raymond.
0
 
LVL 2

Author Comment

by:rene100
ID: 1362747
Thanks for your help!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question