home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- 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
- From: friesenda@skyfox.usask.ca
- Subject: RE: Updating
- Message-ID: <19AUG92.06011743@skyfox.usask.ca>
- Sender: news@access.usask.ca (USENET News System)
- Nntp-Posting-Host: skyfox
- Organization: University of Saskatchewan
- References: <1992Aug19.041343.23349@Armstrong.EDU>
- Date: Wed, 19 Aug 1992 06:01:17 GMT
- Lines: 35
-
- In a previous article, newso584@Armstrong.EDU (Robert Newsome) wrote:
- >This question may be naive, but is there a way that I can add records to a
- >pascal file that already exits? i.e. an open command instead of rewrite?
-
- Yep. Use the RESET command instead of REWRITE. You may also have
- to SEEK to the end of the file first before adding the records.
-
- In Turbo Pascal you should be able to do something like: (this is off
- the top of my head, so don't take it as being the word of God or
- anything :)
-
-
- VAR
- F : FILE of (whatever your record type is);
-
- .
- .
- .
- Assign( F, "MYFILE" );
- Reset( F );
-
- Seek(FileSize( F )); { This should take you to the end of the file }
-
- {add you records here}
-
-
- As I said, this is off the top of my head so you may have to play
- with it a little bit first. Hope it helps.
-
-
-
- -----------------------------------------------------------------------------
- Darryl Friesen | "The vet let me keep them... they're my testicles"
- Univ. of Saskatchewan | - Far Side cartoon: dog talking to his buddy.
- friesenda@sask.usask.ca |
-