Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Building a Conditional Variable
Message
De
02/09/2008 09:18:18
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
02/09/2008 09:08:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01344079
Message ID:
01344092
Vues:
19
>>I have a variable, m.FilterCondition, that is built as criteria is selected on the form. For example:
>>
>>m.FilterConditon = m.FilterCondition + " AND SomeValue = SomeOtherValue01"
>>
>>This works great until the same condition is selected again:
>>
>>m.FilterConditon = m.FilterCondition + " AND SomeValue = SomeOtherValue02"
>>
>>Now m.FilterCondition has both clauses, which causes problems. How can I ensure that I have a good conditional variable?
>
>Most likely, you could check if 'SomeValue' is already in the condition and replace that part of the string instead of adding to it. You could keep list of conditions in the cursor, so checking could be easier.

Interesting. So, you mean to create a cursor, add a record for each condition, then search for the condition to determine if it should be used or not? I could have a flag on each record that detemines whether to use it or not. Rebuild the filter each time based on that rather than using a variable that just keeps getting added to. I like it. That is what you meant, sort of, right?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform