Lists of Components: TCollection and TCollectionItem

It's common for components to maintain or own a list of items such as data types, records, objects, or even other components. In some cases, it's suitable to encapsulate this list within its own object and then make this object a property of the owner component. An example of this arrangement is the Lines property of a TMemo component. Lines is a TStrings object type that encapsulates a list of strings. With this arrangement, the TStrings object is responsible for the streaming mechanism used to store its lines to the form file when the user saves the form.

What if you wanted to save a list of items such as components or objects that weren't already encapsulated by an existing class such as ...

Get Borland® Delphi™ 6 Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.