switch (value)
{
case 1:
case 2:
case 3:
// value could be 1, 2 or 3
break;
case 4:
case 5:
case 6:
// value could be 4, 5 or 6
break;
default:
// value can be anything else
break;
}
Select Case value
Case 1, 2, 3
' value could be 1, 2 or 3
Exit Select
Case 4, 5, 6
' value could be 4, 5 or 6
Exit Select
Case Else
' value can be anything else
Exit Select
End Select
You have the value from your case evaluation that should tell you all you need to know.
I am not a VB programmer, so you'll have to do with a C# example
Code:switch (value) { case 1: case 2: case 3: // value could be 1, 2 or 3 break; case 4: case 5: case 6: // value could be 4, 5 or 6 break; default: // value can be anything else break; }
Select Case value
Case 1, 2, 3
If value = 1 Then
End If
If value = 2 Then
End If
If value = 3 Then
End If
' value could be 1, 2 or 3
Exit Select
Case 4, 5, 6
Select Case value
Case 4
' value is 4
Case 5
' value is 5
Case 6
' value is 6
End Select
' value could be 4, 5 or 6
Exit Select
Case Else
Exit Select
End Select
Like this
Code:Select Case value Case 1, 2, 3 If value = 1 Then End If If value = 2 Then End If If value = 3 Then End If ' value could be 1, 2 or 3 Exit Select Case 4, 5, 6 ' value could be 4, 5 or 6 Exit Select Case Else Exit Select End Select