Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CASE statements
Message
De
24/10/2003 16:18:29
 
 
À
24/10/2003 16:01:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00838740
Message ID:
00842445
Vues:
34
>So why not write:
Return firstStep() ;
>>>>   And secondStep() ;
>>>>   And thirdStep() ;
>>>>   And fourthStep()
>>>
>>>You are right all must return .T., but not at the same time, i.e. as the code in the original CASE statement implies all steps need the previous step to be commited before.
>>>In your example, all steps are executed, at that might not be what's intended, they are supposed to be conditional steps. If they are not, then your code is OK.
>>>
>>>Javier.
>>
>>PMFJI, but in VFP, if one .AND. condition fails, the remainder are skipped, so it works exactly the same, e.g.
>
>Trey,
>
>it's all about the same principle. To understand the RETURN code you have to know how VFP compiles and executes several chained conditions; what's more, you even have to probe that it works, that VFP does it the way you think it does.
>This means that to understand your code one has to write a piece of code to see if VFP does it right, and so on. It's unnecesary time wasted to write a very simple piece of code, and besides you don't make it clear that it's really a conditional chain of steps. This thread is about code clarity and easy maintenance, and the RETURN code is neither one.
>
>Just my opinion.
>Javier.


I went off subject: I merely corrected your statement that "all steps are executed" in Houston's example code, and provided an example to demonstrate this fact more clearly to folks who did not know this. I did not have to probe it, I already knew. When you know that VFP works this way, that it is a conditional chain of steps is obvious.
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform