Subject Re: applyLocate and apostrophe applylocate limit ?
From Mervyn Bick <invalid@invalid.invalid>
Date Mon, 19 Aug 2024 12:29:40 +0200
Newsgroups dbase.getting-started

On 2024/08/19 11:35, Dirk C wrote:
> Op 18/08/2024 om 15:37 schreef Mervyn Bick:
>
> Mervyn,
>
> thanks for your detailed information
>
> i already sampled out with square quaotes, but mis placed the quotes,
> afterwards i used the apostroph function, you gave me once, to use in
> calling a form, which succeded,
>
> now i tested  with numbers aswell, all ok
>
> i think Ken should mentioned in his book
>
> and i suppose findkeynearest function is a refined applylocate
>

findKeyNearest() and applyLocate() work quite differently.

findKeyNearest() requires the rowset to have an active index on the
search field.  dBASE goes straight to the required record, or if it
isn't found, the next record in the ordered rowset.

applyLocate() does not require the rowset to have an active index.  It
starts at the top of the rowset and looks at each record until it finds
a match.  If it doesn't find a match the rowpointer moves to the last
record.  How the comparison is made depends on the setting of the
rowset's locateOptions property.  Although an index isn't required dBASE
will use one if it exists (even if it isn't active) to speed up the process.

Mervyn.