unless your using a little bit of your brain, it's true.
Code:
plah plah plah
Avar=Whatever
Gosub StartSelectCase
plah
plah
plah
'
'
'
StartSelectCase:
If AVar=1 then
Dosomething
Return
Endif
If AVar=2 then
Dosomething
Return
Endif
'
'
'
If AVar=x then
Dosomething
Endif
Return
V2
Code:
AVar = Whatever
StartSelectCase:
If AVar=1 then
Dosomething
Goto EndSelectCase
Endif
If AVar=x then
Dosomething
Goto EndSelectCase
Endif
'
'
'
If AVar=y then
Dosomething
Endif
EndSelectCase:
Sort of what's under the SelectCase hood.
Now depending how the compiler, language interpret/optimise it, one can be faster than the other. It's hard to tell which will ALWAYS be faster so far as there's millions (and more) different possible itteration/conditions.
Both get the job done! One is easier to read, implement debug.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks