Quote:

Quote:

There is no issue of efficiency



Not quite true. Since SELECT CASE enumerates to the first true CASE, I believe it would not bother to enumerate any subsequent CASEs, hence efficiency. IF statements would continue enumerating.




No, if you write a "select" type construct using IFs it is just as efficient, as it works in the same way.

As an example, take a simple SELECT construct:
Code:
$Value=3
Select
Case $Value > 2
"Value is greater than 2" ?
Case $Value > 1
"Value is greater than 1" ?
EndSelect



Constructed with IFs this becomes:
Code:
$Value=3
If $Value > 2
"Value is greater than 2" ?
Else If $Value > 1
"Value is greater than 1" ?
EndIf
EndIf



They both do the same thing. Using IFs however as I mentioned is hard to read and difficult to maintain.

If you coded this badly with IFs like so:
Code:
$Value=3
If $Value > 2
"Value is greater than 2" ?
EndIf
If $Value > 1
"Value is greater than 1" ?
EndIf



Not only is this less efficient as both conditionals are evaluated, but it is actually completely different logic than the previous two example as both conditionals will evaluate as true.

Thinking about it a little more, there may be a small overhead in maintaining the IF stack - or there may not. It depends on the internal KiXtart mechanisms.