Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Regex and multiple word search
Message
De
09/07/2009 09:58:19
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01411109
Message ID:
01411149
Vues:
22
>>This is from my memory, this solution is very clean and easy to implement. And it really works...!
>>
>>lcTextToFind='mouse trap living toom'
>>lcWord=GetWordNum(lcTextToFind,1)
>>Select * from yourtable where lcWord$yourfield into cursor curdummy readwrite 
>>if _tally>0 and GetWordCount(lcTextToFind)>1
>>   For lnX=2 to GetWordCount(lcTextToFind)
>>      lcWord=GetWordNum(lcTextToFind,lnX)
>>      Select * from curDummy where lcWord$yourfield into cursor curdummy readwrite
>>   EndFor 
>>EndIf
>>
>>
>
>Hi Tore,
>
>Just curious, if you have time, could you please compare this solution with Borislav's solution on big tables and see which one would outperform?
>
>Also, I'm guessing, you need to add spaces before and after if we want to check for the word, not the part of the word. That's minor detail, though.

This a very different job than the thread you refer to. This solution is usable where you want to find all records where one or more words are inside a field. I use $, but it may be possible that AT() or some other funcion is faster.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform