Jeremy

Are the records fixed length?, Why not use a 'empty record' marker
and reuse them when you next insert, Even if you can reuse them the unused
record can be skipped
and then you could recode the xBase 'pack' utility

Neven


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Friday, 6 April 2001 02:49
Subject: [DUG]: deleting from a File


> HI all.
>
> I was wondering if there is a way to do the following better, i.e. a
procedure/fuction I can use.
>
> I have a flatfile DB that I save record structures into.
> >From time to time, I want to delete a record from the file.
> I can EDIT the record ok, but to delete a record I do the following :-
>
> Loop thru the records putting the records that dont match the name I am
looing for into another flatfile DB, and when the name I am want to delete
is found I the just dont add that record to the new DB, then when its
finished, I delete the DB, rename the second one back to the original one,
i.e. from db.tmp to db.dat etc.
> But I wonder if this IS the best way. It does delete duplicate names too,
but thats my fault..
>
> Can anyone suggest a better way ?
>
> Cheers, Jeremy Coulter
>
>
>
> Jeremy Coulter (Manager)
> Visual Software Solutions
> Christchurch, New Zealand
> PH 03-3521595
> FAX 03-3521596
> MOBILE 021-2533214
> www.vss.co.nz
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to