Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Regex and multiple word search
Message
From
09/07/2009 09:58:19
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01411109
Message ID:
01411149
Views:
21
>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform