RE: TZF - DeleteRec

[email protected] Tue, 8 Jul 2003 13:31:44 -0400
Newsgroups gmane.comp.lang.delphi.topaz
Message-ID <[email protected]>
Thanks again.

But I am looking for a way not to traverse all the records one by one to
delete, I indexed my Database to make my delete operation faster. For now I
am doing something similar your example, but I do not like it. I log some
data every 1/10 of a second so the database is huge and deleting records by
traversing every record will make my application slow.

Thanks!


-----Original Message-----
From: Eitan Gilboa [mailto:[email protected]]
Sent: Tuesday, July 08, 2003 12:22 PM
To: [email protected]
Subject: Re: TZF - DeleteRec


>> could you write me the Delphi format of "Delete all FOR <condition>"

You can use the POKE commend:

for example delete next HowMany records:

             begin     //Poke('*', 0, CurrRecord); // 0=FldNo, = Deleted
byte
               j := TzDbf1.RecNo;
               k := j + HowMany;
               While j < k do
               begin
                  Poke('*', 0, j);
                  inc(j)
               end; //while
             end;

or, without POKE:

             BEGIN
             // here below is the condition:
               While ( (howMany > 0) AND (NOT TzDbf1.dEOF) )do
               begin
                 TzDbf1.DeleteRec;
                 Dec(HowMany);
                 TzDbf1.Skip(1);
               end;
             END;
             TzDbf1.EnableControls;

HTH,

Best wishes,

Eitan.
URL: http://perso.wanadoo.fr/eitang

==^================================================================
This email was sent to: [email protected]

EASY UNSUBSCRIBE click here: http://topica.com/u/?clvXPN.a5kvff.Z2NsZHQt
Or send an email to: [email protected]

TOPICA - Start your own email discussion group. FREE!
http://www.topica.com/partner/tag02/create/index2.html
==^================================================================