This section describes how 'Select Case' statements work. If one of the expected value in a case clause equals to the test value, the statement block in that case clause will be executed.
"Select Case" statement is an alternative way of executing statements selectively based on certain conditions.
Here is the syntax of "Select Case" statements:
Select Case test_value
Case expected_value_list_1
statement_block_1
Case expected_value_list_2
statement_block_2
...
...
Case Else
statement_block_n
End Select
where "test_value" is a value used to test against with expected values specified in the "Case" clauses,
and "expected_value_list_*" are lists of expected values.
The execution of "Select Case" statement goes like this:
Each "Case" clause will be visited sequentially from top to bottom.
If one of the values in the expected value list equals to the test value in a "Case" clause,
the statement block in that clause will be executed.
If the statement block of any "Case" clause gets executed, the entire statement ends.
The "Case Else" clause is a special clause. Its statement block will be executed if and only if
no statement block of any other "Case" clauses gets executed.