Help on how to insert/delete a record in a file

To add comments, please log in or register
macpee
555
macpee  
I need to know how to insert a record to file, or to delete a record for that matter. More like database management. I used to think that FileSeek(Handle, 0, SEEK_CUR) would point to a position where a record would be written. But it does not point to any position. If the records were numbered, this would be easy (primary key for database management). Same goes with deleting a record. Thanks in advance.
lippmaje
185
lippmaje  
The only way you can do this is opening a new file and writing all content of the original file into it, except the lines that should be deleted of course. Then close both files and replace the old file with the new one.
macpee
555
macpee  
Thanks friend. This is a good idea.
To add comments, please log in or register