Re: Newbie question about release, freeAndNil, etc



"e.p" <e.p@xxxxxxxxxxxxxxx> wrote in message
news:430EE35C.31473303@xxxxxxxxxxxxxxxxxx
> Maarten Wiltink wrote:

>> The forms should preferably register and unregister themselves
>> with this list from the constructor and destructor, and be
>> free-on-close so you don't go nuts juggling them. Basically,
>> the single variable is replaced by a collection.
>
> Does TCollection have some code that has that kind of free-on-close
> property for Forms, or what is all that? I have never used
> TCollections, I wonder if someone has code snippets how to use it
> with Forms.

No, sorry. That was just a poor choice of words on my part.
TCollection has nothing to do with this. You _can't_ even use it
because you'd have to derive your forms from TCollectionItem,
and they already have to be derived from TCustomForm[0].

Stick with the word "list", that's the usual implementation.

Groetjes,
Maarten Wiltink

[0] Directly or indirectly. TForm is more often used.


.