Re: reading/writing to typed files

Posted by Classified on April 15, 2001 at 01:11:36:

In Reply to: reading/writing to typed files posted by Tony fish on April 09, 2001 at 11:10:50:

: I am a programmer but I am new to delphi 4.
: I need to know how to read/write to a typed file.
: My project is to:-
: a. create a typed file and add several records to it.
: b. at a later date, retrieve a specific record and update it.
: I have only managed to create and add 1 record. every time i try to add a new record, it overwrites the first one.
: can anyone provide me with some code examples??
: thanks

You probably used the rewrite procedure the second time and thus erased the contents of the existing file. Rewrites deletes the contents of an existing file and creates a new one. If you want to add records to an existing file, use Reset on the file. It opens the file for reading/writing but doesnt change its contents.