The following is a C program fragment
switch (number)
{
case 1: dosomething; break;
case 2: dosomething; break;
case 3: dosomething; break;
case ......
default: whatever;
}Switch is basically select renamed, and a different syntax because it's a different language of course.
The counterpart in Blitz is
Select number
Case 1 something
Case 2 something
Case 3 something
Case ....
Default somethingelse
End Select
In Blitz the select..case is convered into the equivalent if..else chain. Ie
If number = 1 Then something ElseIf number = 2 Then something ... Else somethingelse EndIf
So the difference is purely "cosmetic"
There are ifs and elses in C of course, but the switch..case compiles into DIFFERENT code than the equivalent if..else would do.
In an if-chain (if..elses in C, either in Blitz) the check has to start at the first check, then the second, then the third... all checks up to the one that is true are made. In a true switch..case the computer jumps *straight* to the number required, so the number of cases is irrelevant. But there are a few limitations. If I remember correctly, a switch..case can only check constant numbers, not variables or "complex" checks that an if can.
This means that cases which occur lower down in a select block will be very slightly slower to access in Blitz, but on any kind of modern computer the time is negligiable, unless you're making some kind of super number-cruncher program, so don't worry too much about it.