Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!midway!iitmax!soudan From: soudan@iitmax.iit.edu (Bassel Soudan) Newsgroups: comp.sys.mac.programmer Subject: Re: removing objects from THINK CList class Message-ID: <1991Jan21.201714.886@iitmax.iit.edu> Date: 21 Jan 91 20:17:14 GMT References: <1991Jan20.180309.2791@fennel.cc.uwa.oz.au> Reply-To: soudan@iitmax.iit.edu (Bassel Soudan) Organization: Illinois Institute of Technology Lines: 20 I faced a similar situation where I had to remove all the objects from a list without disposing of them. ( I had two lists sharing some of their objects, and I wanted to remove the objects from one list and still keep them in the other.) What I ended up doing was write a RemoveAll method and add it to the CList class. In this method I saved the number of objects in a local variable and used that as my counter to remove the first item in the list that many times. It works fine. Watch out though because once you make this change, your CList class is no longer the same as the CList that came with TCL. And by the way, when you try to run the project, it will recompile every single file included in the project. I hope this helps. I am sorry but due to Symantec's copyright I can not publish the exact code for this method, but I think that there won't be any problem if someone needed an e-mail copy of it. Bassel soudan@iitmax.iit.edu