Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AND and OR evaluations in conditional statements
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
AND and OR evaluations in conditional statements
Miscellaneous
Thread ID:
00206066
Message ID:
00206066
Views:
70
Does Foxpro exaluate all ANDs before any ORs in a conditional statement, or does it evaluate them in order?

How would VFP evaluate the following IF statement?

c1 = "1"
c2 = "X"
c3 = "X"

IF c1 = "1" or c2 = "2" and c3 = "3"

Would it evaluate the previous IF statement to be like the first or second IF statement below?

if (c1 = "1" or c2 = "2") and c3 = "3" && evaluates to .f.
if c1 = "1" or (c2 = "2" and c3 = "3") && evaluates to .t.

Thanks - Brenda
Next
Reply
Map
View

Click here to load this message in the networking platform