Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Seek() with wildcards (*?)
Message
De
15/05/2001 00:32:10
David Fluker
NGIT - Centers For Disease Control
Decatur, Georgie, États-Unis
 
 
À
14/05/2001 18:50:54
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00506837
Message ID:
00507144
Vues:
15
>Hi David
>
>Yes, but in order for LOCATE to optimize, you would have to build the correct index for such a search when the user specifies the search criteria. In other words, there is no way to optimize locate for these searches. You are correct that the CONTINUE would probably be pretty fast, once the first locate has been performed.
>
>However, if I understand it properly, Fox should out perform Access on such searches because Access does not use a fixed width record. It seems to me it would have to perform more manipulations of the data to read the correct field to get to the correct record.

Mike,
Quite true. Rushmore can only optimize if properly indexed. The good thing about LOCATE is it works either way. I assumed that Larry would index Container if he wanted to use it in a SEEK. So LOCATE FOR CONTAINER = "Test123" would be optimized and produce a very quick result. Not quite as fast as SEEK "Test123", but fast. And he'd also have access to CONTINUE to find additional matches. The extra benefit here is he can use the same code for unoptimized searched. LOCATE FOR "123" $ Container or LOCATE FOR ATC("123",Container) and it all still works. May not be optimized, but it works.

In fact, by created a search function using LOCATE, and passing the search parameter, he could use Macro Expansion to handle *any* valid search. (LOCATE FOR $cSearchParam) His front end could allow Begins with, Contains, Ends with, Does not contain, etc,. And he could add new ones later without changing the search function.
David.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform