home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / pascal / 6866 < prev    next >
Encoding:
Text File  |  1992-11-24  |  1.2 KB  |  32 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!cs.utexas.edu!torn!news.ccs.queensu.ca!slip210.telnet1.QueensU.CA!dmurdoch
  3. From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
  4. Subject: Re: TPW TCollection
  5. Message-ID: <dmurdoch.185.722582564@mast.queensu.ca>
  6. Lines: 20
  7. Sender: news@knot.ccs.queensu.ca (Netnews control)
  8. Organization: Queen's University
  9. References: <1992Nov19.081727.18386@usage.csd.unsw.OZ.AU> <92328.152730F0O@psuvm.psu.edu>
  10. Date: Tue, 24 Nov 1992 05:22:45 GMT
  11.  
  12. In article <92328.152730F0O@psuvm.psu.edu> F0O@psuvm.psu.edu writes:
  13. >   I would simply make the following changes to your code:
  14. >
  15. >Old code:
  16. >  ClientInformation = record
  17. >
  18. >New code:
  19. >  ClientInformation = object(TObject)
  20. >
  21. >   Now you can store your client information into the collection.
  22.  
  23. You can store it even if it's not an object; the problem comes when you 
  24. dispose of the collection, since it attempts to call the Done destructor for 
  25. each item that it contains.  Just making the change you suggested isn't 
  26. enough to fix this; the objects wouldn't be initialized, so the Done call 
  27. wouldn't be possible.  You also need to call the constructor for each object.
  28. (There's no need for a new ClientInformation constructor; the inherited 
  29. TObject.Init constructor is good enough.)
  30.  
  31. Duncan Murdoch
  32.