home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / pascal / 4903 < prev    next >
Encoding:
Text File  |  1992-08-18  |  1.5 KB  |  48 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!usc!sol.ctr.columbia.edu!destroyer!ubc-cs!unixg.ubc.ca!kakwa.ucs.ualberta.ca!access.usask.ca!skyfox.usask.ca!friesenda
  3. From: friesenda@skyfox.usask.ca
  4. Subject: RE: Updating
  5. Message-ID: <19AUG92.06011743@skyfox.usask.ca>
  6. Sender: news@access.usask.ca (USENET News System)
  7. Nntp-Posting-Host: skyfox
  8. Organization: University of Saskatchewan
  9. References: <1992Aug19.041343.23349@Armstrong.EDU>
  10. Date: Wed, 19 Aug 1992 06:01:17 GMT
  11. Lines: 35
  12.  
  13. In a previous article, newso584@Armstrong.EDU (Robert Newsome) wrote:
  14. >This question may be naive, but is there a way that I can add records to a
  15. >pascal file that already exits?  i.e. an open command instead of rewrite?
  16.  
  17. Yep.  Use the RESET command instead of REWRITE.  You may also have
  18. to SEEK to the end of the file first before adding the records.
  19.  
  20. In Turbo Pascal you should be able to do something like: (this is off
  21. the top of my head, so don't take it as being the word of God or
  22. anything :)
  23.  
  24.  
  25. VAR
  26.    F : FILE of (whatever your record type is);
  27.  
  28. .
  29. .
  30. .
  31. Assign( F, "MYFILE" );
  32. Reset( F );
  33.  
  34. Seek(FileSize( F ));  { This should take you to the end of the file }
  35.  
  36. {add you records here}
  37.  
  38.  
  39. As I said, this is off the top of my head so you may have to play
  40. with it a little bit first.  Hope it helps.
  41.  
  42.  
  43.  
  44. -----------------------------------------------------------------------------
  45. Darryl Friesen          |  "The vet let me keep them... they're my testicles"
  46. Univ. of Saskatchewan   |   - Far Side cartoon: dog talking to his buddy.
  47. friesenda@sask.usask.ca |
  48.