[fpc-pascal]How to delete records from a file

A.J. Venter ajventer at direqlearn.org
Fri Dec 6 07:57:24 CET 2002


I am extremely embarassed to be asking this, but I haven't worked with typed 
files in so long that frankly I cannot remember.

Say I have this code:

Type someRec = record
		a :String;
		I : Integer;

Var FoS : File of SomeRec;

Now lets say FoS contains three entries and I wish to remove the first one.
A simple shift up loop will technically remove it, 
entry1 := entry2;
entry2 := entry3;

But how do I then get rid of the duplicate entry two ? 

In other words, next time a record is added how do I ensure that it is added 
at the third position in the file and not the fourth ?


More information about the fpc-pascal mailing list