[fpc-devel] LocateNext

Luiz Americo Pereira Camara pascalive at bol.com.br
Mon Apr 10 17:31:02 CEST 2006


Micha Nelissen escreveu:
> On Mon, 10 Apr 2006 12:33:18 +0200
> Joost van der Sluis <joost at cnoc.nl> wrote:
>
>   
>>> If you don't want to limit, then set .Filtered := false; and use
>>> FindFirst etc.
>>>       
>> wich won't work with current sqldb, since filtering there simply adds a
>> 'where' part to the query.
>> An which is much slower then locate and locatenext. 
>>     
>
> Same story for TDbf :-).
>  
>   
>> Isn't the mean reason why you and Michael aren't using locate, that
>> locatenext is missing?
>>     
>
> Oh, I am using Locate. I'm just talking from the general TDataSet POV.
>
> That said, LocateNext may be useful, but I would rather add a flag to
> Locate; a TLocateNagivation (lnFirst, lnPrior, lnNext, lnLast), with the
> default being lnFirst, thus compatible. It's a bit more flexible.
>
> OTOH, is it really impossible to do it the "right" way, implementing the
> filter more efficiently, in sqldb ?
>
> Adding redundant ways to do the same thing is not ideal IMHO.
>   
Just one information. I based the LocateNext implemetation of 
TCustomSqliteDataset in the found at FIBL which was the only TDataset 
that had it implemented.
Here is the FIBL approach:

function Locate(const KeyFields: String; const KeyValues: Variant;
      Options: TLocateOptions): Boolean;
function LocateNext(const KeyFields: String; const KeyValues: Variant;
      Options: TLocateOptions): Boolean; // Sister function to Locate

Luiz



More information about the fpc-devel mailing list