Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CASE statements
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00838740
Message ID:
00841649
Views:
21
>
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform