Information générale
Catégorie:
Codage, syntaxe et commandes
Hi John..
Try this,
? (.t. or .t.) and .F.
? .t. or .t. and .F.
The second expression *does not* evaluate left to right, it uses precedence.
(It took me a while to find this example, even though it's so simple)
>My understanding is that the MDAS rules apply to expressions but that all ANDS and ORs (logical operators) are evaluated as encountered, left to right, before all else. So, you have this situation:
>
>STORE .F. to x,y
>STORE .T. to z
>
>x AND y AND z = False
>x AND y OR Z = True
>
>Why True? Because the compiler reads the AND and groups x and y and evaluates....then encounters the OR and sets z off in it's own part of the equation. x and y are False but z is therefore, true it is.
>
>
>>>But * IS evaluated before + is every case;
>>>
>>>?5+2*7 && 19
>>>?2*7+5 && 19
>>>?7*2+5 && 19
>>>
>>>The multiplication is always done before the addition.
>>My Dear Aunt Sally (Multiply Divide Add Subtract) Elementry school math...
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement