Select Case

来源:百度知道 编辑:UC知道 时间:2024/06/06 02:38:14
Dim i As Integer
i = 90
Select Case i
Case 100 To 90
Print "good"
Case 89 To 70
Print "cool"
Case 69 To 60
Print "great"
Case 59 To 0
Print "bad"
Case Else
Print "error"
End Select
为什么运行输出的总是 error
请说明我的为什么不对 谢谢

case 100 to 90 改为 case 90 to 100
下面的那些也是一样
小数字要放前面

Dim i As Integer
i = 90
Select Case i
Case Is <= 90
Print "good"
Case Is <= 70
Print "cool"
Case Is <= 60
Print "great"
Case Is <= 0
Print "bad"
Case Else
Print "error"
End Select

楼主改改成这样就好啦