home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / pascal / 5134 < prev    next >
Encoding:
Text File  |  1992-08-31  |  1.2 KB  |  52 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!fmsrl7!lynx!nmsu.edu!opus!trodgers
  3. From: trodgers@nmsu.edu (Thomas Rodgers)
  4. Subject: Re: Problem with Stream
  5. In-Reply-To: phshl@wombat.newcastle.edu.au's message of 26 Aug 92 12:57:58 GMT
  6. Message-ID: <1992Aug31.223042.1178@nmsu.edu>
  7. Sender: usenet@nmsu.edu
  8. Organization: NMSU Computer Science
  9. References: <1992Aug26.225758.1@wombat.newcastle.edu.au>
  10. Date: Mon, 31 Aug 1992 22:30:42 GMT
  11. Lines: 39
  12.  
  13. > the questions are,
  14.  
  15. >1. how do I store the PCollection variable? ...
  16.  
  17. Well, its rather simple really.
  18.  
  19. Suppose you have the following field in your object :
  20. TSomeObject = object
  21.    goo : PCollection;
  22.  
  23.    constructor Load(var s : TStream);
  24.    procedure Store(var s : TStream);
  25. end;
  26.  
  27. The code for Store would be :
  28.  
  29. procedure TSomeObject.Store;
  30. begin
  31.   S.Put(goo);
  32. end;
  33.  
  34. The code for Load would be
  35.  
  36. constructor TSomeObject.Load;
  37. begin
  38.   goo := S.Get;
  39. end;
  40.  
  41. > 2.  When I tried to put the TTS object onto a stream in the
  42. > main...(stuff deleted)
  43.  
  44. I am not sure if this is your problem or not, but the defintion for
  45. store should go :
  46.  
  47.   procedure store(var s : TStream)
  48.     NOT 
  49.   procedure store(var s : TBufStream)
  50.  
  51. Tom.
  52.