If you are using VFP9, why won't a SELECT statement work?
Something like:
SELECT TOP 1 * FROM table WHERE condition ORDER BY key DESC INTO CURSOR tmp
Just make sure you create index(es) on the condition field(s) so Rushmore will kick in and it should give you a reverse order cursor with all the matching values in a flash.
Is there a reason you want to use LOCATE instead?
Paul H. Tarver
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Gene Wirchenko Sent: Wednesday, July 03, 2019 11:47 AM To: profoxtech@leafe.com Subject: LOCATE Backwards?
Hello:
I have a situation in my app where I am having to pick up what will presumably be the last row in a table. Mind you, the general situation is that it might not be if in a multiuser situation.
With the current situation, I can use an index to find that row really fast.
BUT ...
What if an index is not appropriate? Is there any way to do a LOCATE backwards (or something equivalent)? (The table has 186,574 rows currently so searching backwards would definitely be worth it.) I do not think there is such a critter, but maybe, you know better?
Sincerely,
Gene Wirchenko
[excessive quoting removed by server]