Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CASE statements
Message
De
24/10/2003 15:27:49
 
 
À
24/10/2003 15:13:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00838740
Message ID:
00842421
Vues:
38
>>>return llSuccess
>>>So basically you are saying that all four Steps need to return True in order for lSuccess to be True. 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.
If test1() And test2() And test3()
  ? "Passed"
Else
  ? "Failed"
EndIf

Function test1()
  ? Program()
  Return .T.
EndFunc
Function test2() 
  ? Program()
  Return .F.
EndFunc
Function test3()
  ? Program()
  Return .F.
EndFunc
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