Thanks Mike.

I have read the other thread where there are some arguments re : pointers, and would like to make the observation that pointers are indispensable when you don't know, in advance, how many objects you will require.

This is the situation I have at the moment.

At one part of the application, an object is created and added to a TList. For all sorts of reasons, I want to create a TList object in another part of the application, and have each pointer in the list pointing to the SAME object in the first list.

I am not explaining myself very well.

What I want to happen is that in the first part of the application, I create objects and add them to the items property of a TList object. This first TList holds a whole bunch of objects, in this case, all to do with serial comms.

Great. Now, in another part of the application, I want to create a manager object for a small subset of the first list - say, for example, objects who all handle serial comms in the same way. I do not want to create NEW objects in the second list : I want to access the SAME objects pointed to in the first list.

The purpose of this is that the first list handles ALL comms to and from the serial ports.

The second object handles ONLY the objects of a certain kind. And mostly, what it does is provide an interface to the rest of the application.

How do i accomplish this?

regards

Tim


_______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

Reply via email to