Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AND and OR evaluations in conditional statements
Message
De
14/04/1999 07:05:37
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00206066
Message ID:
00208119
Vues:
32
David,


>Jim,
>
>>So WHY do you attribute this to "the optimizer", that is the question?
>
>Because I know of no other thing to credit the optimization to. How else can you explain why l2() is never called in this code:
>
>? l1() or l2()
>
>function l1
>? program()
>return .t.
>
>function l2
>? program()
>return .f.
>
big snip

Come on now...it would be ridiculous for VFP or any other language to continue beyond the OR! This is *not* optimization, it is just the way sensible programming works! Do you think (or expect) that all CASEs of a CASE structure are evaluated beyond the one which 'triggers'? Using your logic most compilers would and those that did not would be credited as having an optimizer!

Give this just a little bit of thought, will you. *Anything* beyond your 'OR', no matter what it is or how long it is or how many parenthesis it might have, cannot affect the result. To call observance of this fact 'optimization' is to look for crediting VFP with something that just isn't so. It *would* be poorly done if it did anything else!

Jim N
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform