Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Letters should be found in a string - what is the best?
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00428574
Message ID:
00428653
Vues:
30
><<snip>>
>>>Hi Nadya,
>>>
>>>Here we go :)
>>>
>>
>>>* return criterion for field value
>>>lnLen=alen(.btcSelArray, 1)
>>>lcSelList = ""
>>>for li = 1 to lnLen	&& cycle over rows in the array of selected items
>>>	lcSelList = lcSelList + .btcSelArray[li]
>>>endfor
>>>
>>>lcCrit = [ Not Empty(mapto) AND Empty( Chrtran(mapto, Chrtran(mapto, lcSelList, ""), "")) ]
>>>
>>
>>Hi Sergey,
>>
>>Not sure, I understand your idea:
>>
>>mapto='ABCFDG'
>>lcSelList='AG8'
>>?Chrtran(mapto, Chrtran(mapto, lcSelList, ""), "")
>>
>>
>>Let me try to explain again:
>>I'd like to select all records, which satisfy my criterion:
>>
>>In main table (from which I want to select), I have: (example)
>>
>>1   ABCD
>>2   AB
>>3   FG
>>4   AF8
>>
>>etc.
>>
>>User selects A and 8, so records 1,2,4 should be selected.
>>Note, also, what my control allows exclude items, IOW, if I check exclude option, only record 3 should be selected (doesn't contain A or 8).
>>
>>See?
>>
>>Thanks in advance.
>

>Ok let's see ...
>
>lcSelList='A8'
>lcResult = Chrtran(mapto, Chrtran(mapto, lcSelList, ""), "")
>
>mapto  lcResult
>1 ABCD A
>2 AB   A
>3 FG
>4 AF8  A8
>
>Than criteria should be
>lcCrit = [ Not Empty(mapto) AND Not Empty( Chrtran(mapto, Chrtran(mapto, lcSelList, ""), "")) ]
>
>If you check exclude than criteria should be
>lcCrit = [Empty( Chrtran(mapto, Chrtran(mapto, lcSelList, ""), "")) ]

Hi Sergey,

The definitions changed :) If I select A8, I want only records, which contain both A and 8, IOW,
A $ mapto and 8 $ mapto. (only record 4 satisfies)

If I check exclude option, if records contain either A or 8, exclude them, IOW:
NOT (A $ mapto or 8 $ mapto).

Is where a better way (other than using $)?
BTW, this table doesn't have an index on amenities (mapto) and will not.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform