Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CASE statements
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00838740
Message ID:
00841649
Vues:
23
>
>You may call it a corruption, I call it an elegant and readable solution to a common coding pattern.

Kind of cool. I have never thought about doing something like that. However, I'd have to agree with Jim. It wasn't immediately obvious as to what was happening. I'd modify the code a bit to make it a little easier to understand (eg. add a comment):
Success = .f.

* Run each method in sequence as each CASE
* gets evaluated. If an error occurs, bail
* out, otherwise set Success to true.

DO CASE
   CASE ! This.FirstStep()
   CASE ! This.SecondStep()
   CASE ! This.ThirdStep()
   CASE ! This.ForthStep()
   OTHERWISE
      Success = .t.
ENDCASE

Return Success
Like you, I think that I'd much rather see the above code than a bunch of nest IF statements.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform