Subject Re: applylocate not working
From Heinz Kesting <Nobody@Nowhere.com>
Date Sat, 8 Jun 2024 15:01:40 +0200
Newsgroups dbase.getting-started

Hi Charlie,

> I thought this would be easy since I have done this before but the apply locate is never found.  tgrade is what i am trying to find.  actually it represents a field in the table.  so that isn't the problem (yet) because this never finds tid and cat which are also strings.
>
> i have tried this looking for bith variables and only one which certainly should have been found, but for some reason the applylocate doesn't work.
Well, I know I'm a bit late for the party, but what helped me
understanding ApplyLocate() was first
- using square brackets for building the string to make it easier to
read, and second
- displaying the string that you finally submit to ApplyLocate()

so something like:
cSearchString = [>] + [year = '] + tid + [' and category = '] + tcat +
[']) + [<]
? cSearchString

Now between the pointed brackets you can easily see what you actually
make ApplyLocate() look for.

Finally, please remember to check for apostrophes in the field values.
If this could be the case, make sure you're preceding the apostrophe
with a backslash. For this see the help for the rowset's filter where
this is explained in greater detail.

The rowset's locateOptions have already been discussed, so you should be
Okay now.

Just my two cents, hope they help, too

Kind regards, Heinz