Mega Search
23.2 Million


Sign Up

Make a donation  
procedure inheritance  
News Group: embarcadero.public.delphi.oodesign

I'm confused as to whether this will work. Take this class...

 TPlayList = class(TList)
   function Delete(Index: Integer);
 end;

procedure TPlayList.Delete(Index: Integer);
var
  TrackRec: PTrackRecord;
begin
  TrackRec := Items[Index];
  Dispose(TrackRec);
  inherited;
end;

If I call TPlaylist.Remove or TPlaylist.Clear, which uses the Delete procedure in Classes.pas, will it execute my Delete procedure or the one in Classes.pas?

If it only uses the Delete in Classes.pas, do I have to define my own Remove and Clear procedures?

Thanks.

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 25-Mar-2014, at 12:56 AM EST
From: Ross Levis
 
Re: procedure inheritance  
News Group: embarcadero.public.delphi.oodesign
Thanks Remy.  I think the collections method must be in newer versions of Delphi.  I'm using D7.  I'll use the Notify code, thank you.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 25-Mar-2014, at 10:15 PM EST
From: Ross Levis