Dim 档次() As String = {"一档", "二挡", "三档", "四挡", "五档", "六档", "七档", "八档", "九档"}
Dim a As String = "三档"
Dim b As String = "五档"
Dim a1 As Integer = Array.IndexOf(档次, a)
Dim b1 As Integer = Array.IndexOf(档次, b)
If (a1 < 3 AndAlso b1 > 2) OrElse (a1 < 6 AndAlso b1 > 5) Then
MsgBox("不同级")
Else
MsgBox("同级")
End If
If a1 = b1 Then
MsgBox("同档")
Else
MsgBox(IIf(a1 > b1, "b", "a") & "高一档")
End If