====== Select...Case ======
Select Case variable
[Case value [,value],…
[Statement 1]]
[Case value [,value],…
[Statement 2]]
[Case Else
[Statement 3]]
End Select
If variable meets the value or expression following Case, the code
beneath Case is executed.
Select Case A
Case 1
B = 0
Case 2
B = 2
Case 3,4,5,6 ' Use Comma(,) for more than 1 value.
B = 3
Case Is < 1 ' Use < for logical operations.
B = 3
Case Else ' Use Else for all other cases.
B = 4
End Select
Select Case K
Case Is < 10 ' If less than 10
R = 0
Case Is < 40 ' If less than 40
R = 1
Case Is < 80
R = 2
Case Is < 100
R = 3
Case Else
R = 4
End Select
[[cubloc:index#system_library:|Go CUBLOC home]]