Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AND and OR evaluations in conditional statements
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00206066
Message ID:
00206785
Vues:
15
>Jim,
>
>Even with the early out optimization FoxPro does it still puts AND at a higher precedence than OR. The ability to even do the optimization is basically rooted in the precedence of the logical operators.
>
>>There is no precendence with and and or, they are evaluated from left to right with itelligent parsing in that the evaluation ends as soon as VFP has an answer. That is;
>>
>>a=.t.
>>b=.t.
>>c=.t.
>>? a or b and c && nevers checks b or c because a is .t.


Dave,

It is my understanding that precendence mean sthat one orperation will be performed before another at the same level of parens. That would mean that if an OR and a AND appeared at the same parenthetical level the AND would be evaluated first. However, my testing indicates clearly that the expressions are evaluated from left to right regardless of the position of the and or the or.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform