Christopher Chase
Christopher Chase

Reputation: 2890

delphi TCollection count not increasing after Add

i have the types

NotifyReplylist := TNotifyReplylist.Create(self, TNotifyReply);

After calling this function (Any number of times), Count it still zero

function TNotifyReplylist.addItem: TNotifyReply;
 begin
   Result := inherited Add as TNotifyReply;
   OutputDebugString(PAnsiChar('Count > '+ inttostr(count)));
 end;

Any idea whats going on here?

Upvotes: 1

Views: 747

Answers (1)

Christopher Chase
Christopher Chase

Reputation: 2890

Found the problem, TNotifyReply.Create was

constructor TNotifyReply.Create(ACollection: TCollection);
begin
  inherited Create(Collection);
  ....

changed to

inherited Create(ACollection);

Upvotes: 4

Related Questions