Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How many CASEs in DO CASE?
Message
 
 
To
01/06/2006 23:35:35
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01126584
Message ID:
01126717
Views:
26
>I would guess execution can be slowed down (especially if it is executed many times), because there is no way for VFP to optimize, and directly jump to a specific case. It has to test every case individually. Perhaps a hierarchical search can improve speed, something like this:
>
>
>case nVar < 10
>  do case
>  case nVar = 1
>    ...
>  case nVar = 2
>    ...
>case nVar < 20
>  do case
>  case nVar = 11
>    ...
>  case nVar = 12
>    ...
>...
>
>

Thank you for your input. It makes sense. Though, I have changed my approach since my original message.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform