Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AND and OR evaluations in conditional statements
Message
 
To
09/04/1999 01:38:32
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00206066
Message ID:
00206794
Views:
15
>>David,
>>
>>>AND has precedence over OR ( the opposite to Pascal I suspect )
>>
>>In all the computer languages I've ever worked in, including Pascal, AND has always precedence over OR
>
>That's true. Mainly because this is the mathematical rule. :) Maybe it was about Blaise Pascal? :)
>
>Vlad

Vlad,

Can you show me an example of AND getting evaluated before OR is when the OR is to the left of the AND?

If I ask ? 5 + 2 * 7 the reply is 19 because the * is done before the + due to precedence. But if I ask ? a OR b AND c and a is true the AND never gets evaluated, if I put the and first then the and gets done first. It certainly appears that the expression is being evaled from left to right regardless of teh and/or distribution.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform