Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DO CASE vs IF
Message
From
28/12/2000 13:01:41
 
 
To
27/12/2000 20:31:49
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00457199
Message ID:
00457429
Views:
28
Cindy:

> I looked in HackFox and didn't see mention of speed issues. Could be that
> the CASE statements are turned into IFs anyways.

No, they are not. One easy way to test this is to nest 65+ times
If a = 1 Then
Else
If a = 2 Then
Else
...
EndIf
EndIf

versus 65 cases of a do case.

The IF..ELSE..ENDIF won't compile because they are nested too deep but the DO CASE..ENDCASE will because it seems to only count once in the nest level. This extra DO CASE..ENDCASE functionality probably explains the sluggist performance of DO CASE..ENDCASE versus IF..ELSE..ENDIF.

Daniel
Previous
Reply
Map
View

Click here to load this message in the networking platform