James,
Think of my code as a design pattern for a list, or possibly a template.
You could replace the class name you are storing everywhere in the code and
would then have a completely different List class. A bit like a C++
template, except you have to define all the code each time.
> A question
; FList.Delete(AIndex);
> end;
>
> function Count: integer;
> begin
> Result := FList.Count;
> end;
>
>
> - Original Message -
> From: "James Mills" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, July 0
ree;
>
> inherited;
> end;
>
> function Add(AItem: TMyListItemClass): integer;
> begin
> result := FList.Add(AItem);
> end;
>
> procedure Delete( AIndex: integer );
> begin
> FList.Delete(AIndex);
> end;
>
> function Coun
Result := FList.Count;
end;
- Original Message -
From: "James Mills" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 06, 2003 4:56 PM
Subject: Re: [fpc-pascal]TCollection question
> Actually Michael,
>
> Could you possibly spare 5 mins and giv
Actually Michael,
Could you possibly spare 5 mins and give a really simple example of a
TList descandent ? I'm a tad confused here, (too slowly getting
anywhere)...
Thank you :)
cheers
James
___
fpc-pascal maillist - [EMAIL PROTECTED]
http://lists.f
On Sun, Jul 06, 2003 at 05:31:59PM +0200, Marco van de Voort wrote:
> > On Sun, Jul 06, 2003 at 05:11:17PM +0200, Marco van de Voort wrote:
> > > > which hold a dynamic array of TNick ... Is this what TList already does
> > > > (if so I'm wasting my time writing my own code...) ?
> > >
> > > Prett
> On Sun, Jul 06, 2003 at 05:11:17PM +0200, Marco van de Voort wrote:
> > > which hold a dynamic array of TNick ... Is this what TList already does
> > > (if so I'm wasting my time writing my own code...) ?
> >
> > Pretty much yes, but in a class wrapper. You can add and remove items,
> > iterate
On Sun, Jul 06, 2003 at 05:11:17PM +0200, Marco van de Voort wrote:
> > > IIRC, TCollection only stores TCollectionItem derived classes.
> > >
> > > TList is closer to what you want probably.
> >
> > Is there an example other than list.pp in the fcl source ?
> >
> > Also just for the record of k
> > IIRC, TCollection only stores TCollectionItem derived classes.
> >
> > TList is closer to what you want probably.
>
> Is there an example other than list.pp in the fcl source ?
>
> Also just for the record of knowing... I have attached datanicks.pas
> which hold a dynamic array of TNick ...
On Sun, Jul 06, 2003 at 04:25:15PM +0200, Marco van de Voort wrote:
> > Is there an example of using TCollection or something (without having to
> > write the code myself) that manages a collection of FPC style classes
> > (objects) ?
> >
> > I'd like to see one, code I have written to handle a dy
> Is there an example of using TCollection or something (without having to
> write the code myself) that manages a collection of FPC style classes
> (objects) ?
>
> I'd like to see one, code I have written to handle a dynamic array of
> objects has gone out of control... (Using FPC classes here)
Is there an example of using TCollection or something (without having to
write the code myself) that manages a collection of FPC style classes
(objects) ?
I'd like to see one, code I have written to handle a dynamic array of
objects has gone out of control... (Using FPC classes here)
cheers
James
12 matches
Mail list logo