Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Building a Conditional Variable
Message
From
02/09/2008 09:29:31
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
02/09/2008 09:04:22
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01344079
Message ID:
01344103
Views:
17
>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?

Pressumably, you have two parts of the condition: a "fixed" part, and a "user-supplied" part. Keep the fixed part in a separate variable (or more likely, form property), and then add the user-supplied conditions. Next time the user selects criteria, add those criteria to the fixed part again.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform