Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Network:
Windows 2008 Server
>>>Hi,
>>>I'd create a 'FilterCondition' class containing a string collection (one for each 'individual' filter condition) and a BuildFilter() method that concatenated them all together when needed. The method to add individual conditions to the collection would just need to check the existing collection and only add conditions that were not already there. An additional benefit would be that it would be simpler to remove individual conditions.
>>>
>>>Regards,
>>>Viv
>>
>>Good idea.
>>
>>But I don't understand why
>>
>>myField = 'MyValue' AND myField = 'MyValue' can fail even if the same condition would be repeated twice.
>
>I don't think Jay said that it failed - just that it caused problems. Presumably if the user could add the same condition twice they could add it twenty times. I've no idea whether VFP would optimise out the duplications......
You are right. The issue is that I could have "MyValue = .T. AND MyValue = .F." which is not what I'm necessarily looking for. It doesn't fail, but it doesn't work right either. Edward's idea works great for me.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement