home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!cs.utexas.edu!torn!news.ccs.queensu.ca!slip210.telnet1.QueensU.CA!dmurdoch
- From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
- Subject: Re: TPW TCollection
- Message-ID: <dmurdoch.185.722582564@mast.queensu.ca>
- Lines: 20
- Sender: news@knot.ccs.queensu.ca (Netnews control)
- Organization: Queen's University
- References: <1992Nov19.081727.18386@usage.csd.unsw.OZ.AU> <92328.152730F0O@psuvm.psu.edu>
- Date: Tue, 24 Nov 1992 05:22:45 GMT
-
- In article <92328.152730F0O@psuvm.psu.edu> F0O@psuvm.psu.edu writes:
- > I would simply make the following changes to your code:
- >
- >Old code:
- > ClientInformation = record
- >
- >New code:
- > ClientInformation = object(TObject)
- >
- > Now you can store your client information into the collection.
-
- You can store it even if it's not an object; the problem comes when you
- dispose of the collection, since it attempts to call the Done destructor for
- each item that it contains. Just making the change you suggested isn't
- enough to fix this; the objects wouldn't be initialized, so the Done call
- wouldn't be possible. You also need to call the constructor for each object.
- (There's no need for a new ClientInformation constructor; the inherited
- TObject.Init constructor is good enough.)
-
- Duncan Murdoch
-