Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Speeding up search - Locate For or Seek?
Message
 
 
À
26/07/2000 10:50:58
Erin Eby
Mission Critical Software
Gainesville, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00397065
Message ID:
00397254
Vues:
10
>Hi there! I am a reletively new FoxPro user and I had a question concerning searching a table. I am currently using Locate for's to search for my results, but I have been told that seek is quite faster. Is there something faster than seek? And can anyone explain in a nutshell what makes one faster than the other? Also, I already have a ton of indexes on the table too. Thanks for any answers you all can give me! :)

I don't have time to read all the replies to this thread, so I apologize in advance if someone already gave this tip.

Once you find an initial match with seek where there are multiple possible records matching. You can the use LOCATE to search for a secondary criteria.

SET ORDER TO SomeValuesIndexTag
SEEK Somevalue
LOCATE FOR Field2 = anothervalue WHILE OrderedField = SomeValue

Yes you can use the FOR and WHILE clause in the LOCATE. What happens is only the records matching the initial SEEK value are searched for the Field2 value. So if you have 10 records that matched the first SomeValue, only the next 10 records are searched in the LOCATE. Can't get faster than that.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform