Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro substitution & sql
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00858905
Message ID:
00858946
Views:
14
Jon,

There're no advantages in doing that but it makes your query partialy optimizable and may slow it down.

>I put the 'and' before, rather than after. each checkbox-controlled condition, and preceed them all by a condition that is always checked for. If there's none, I just check for .T., as shown below. If there's a performance hit for doing this, I've not noticed it, since I think VFP is smart enough not to evaluate it for every record.
>
>local lcWhere
>lcWhere = '.T. '
>if this.check1.value
> lcwhere = lcWhere + 'and a = b '
>endif
>
>if this.check2.value
> lcwhere = lcWhere + 'and c = d '
>endif
>
>if this.check3.value
> lcwhere = lcWhere + 'and e = f '
>endif
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform