Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SEEK or LOCATE?
Message
 
To
12/08/1999 13:23:10
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00253099
Message ID:
00253105
Views:
24
>If i'm only going to search for 1-2 records which of the following two methods is best (fastest)?
>
>LOCATE FOR idnr = 'something'
>or
>SET ORDER TO idnr
>seek 'something'
>
>I've almost always used the first method simply becouse it saves one row of code... but I'm now in finetuning stage of my application and want to know which method is the fastest and how many records I must search to take great speed advantages of that method.

The SEEK() function is most efficient, in general, I believe...

=SEEK(keyfield value,'table','tag')

or

IF SEEK(keyfield value,'table','tag')
etc...

You have no SET ORDER problems, and no SELECT alias problems. Speedwise, they're all fairly similar...
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Previous
Reply
Map
View

Click here to load this message in the networking platform