Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Count for AND deleted records
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01125349
Message ID:
01125975
Vues:
18
>>>>>Probably because the logic works like this:
>>>>>?.t. or .t. and .f. && returns .t., no matter what is at the end with AND
>>>>
>>>>?(.t. or .t.) and .f. && returns .f.
>>>
>>>Not quite clear what do you mean. It is reply to me and you do not agree with what I said? Or it is your recommendation to the original author of how to modify his statements?
>>
>>A little bit of both, actually. Your statement of "no matter what is at the end with AND" is a not entirely correct. Usage of parenthesis will change what is returned. Almost any time OR is involved, you have to be careful that your logic is correct (or at least I do) ;)
>
>
>I may agree with you only on parenthesis as a recommendation to original author to use them: parenthesis were not considered in my reply that was strictly related to statements without them:
>?.t. or .t. and .f.
>*or
>?.t. or .t. and .t.


Due to VFP's use of "short circuiting" in logical statements (bails out as soon as it's true) the rest of the statement isn't even evaluated:

? .t. or .t. and (messagebox("You won't see this!")=6)

? (.t. or .t.) and (messagebox("You will see this!")=6)
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform