Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CASE statements
Message
From
24/10/2003 15:13:24
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00838740
Message ID:
00842411
Views:
27
>
>local llSuccess
>>
>>llSuccess = .f.
>>
>>*-- I every step is completed, return .t.
>>if firstStep()
>>    if secondStep()
>>        if thirdStep()
>>            if fourthStep()
>>                llSuccess = .t.
>>            endif
>>        endif
>>    endif
>>endif
>>
>>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform