Private Sub Command1_Click()
rn = Val(Text1.Text)
ri = Val(Text2.Text)
Select Case rn
Case Is >= 0, Is <= 25 Select Case ri
Case Is <= 50
Text3.Text = "一级"
Case Is > 50, Is <= 100
Text3.Text = "二级"
Case Is > 100
Text3.Text = "三级"
End Select
Case Is > 25, Is <= 50 Select Case ri
Case Is <= 25
Text3.Text = "一级"
Case Is > 25, Is <= 50
Text3.Text = "二级"
Case Is > 50, Is <= 100
Text3.Text = "三级"
Case Is > 100
Text3.Text = "四级"
End Select
Case Is > 50, Is <= 100 Select Case ri
Case Is <= 10
Text3.Text = "一级"
Case Is > 10, Is <= 25
Text3.Text = "二级"
Case Is > 25, Is <= 50
Text3.Text = "三级"
Case Is > 50, Is <= 100
Text3.Text = "四级"
Case Is > 100
Text3.Text = "四级"
End Select
Case Is > 100, Is <= 200 Select Case ri
Case Is <= 10
Text3.Text = "二级"
Case Is > 10, Is <= 25
Text3.Text = "三级"
Case Is > 25, Is <= 50
Text3.Text = "四级"
Case Is > 50, Is <= 100
Text3.Text = "四级"
Case Is > 100
Text3.Text = "五级"
End Select
Case Is > 200, Is <= 300 Select Case ri
Case Is <= 10
Text3.Text = "三级"
Case Is > 10, Is <= 25
Text3.Text = "四级"
Case Is > 25, Is <= 50
Text3.Text = "四级"
Case Is > 50, Is <= 100
Text3.Text = "五级"
Case Is > 100
Text3.Text = "五级"
End Select
Case Is > 300 Select Case ri
Case Is <= 10
Text3.Text = "四级"
Case Is > 10, Is <= 25
Text3.Text = "四级"
Case Is > 25, Is <= 50
Text3.Text = "五级"
Case Is > 50, Is <= 100
Text3.Text = "五级"
Case Is > 100
Text3.Text = "五级"
End Select
End Select
不知道哪出问题了,怎么很多数值没办法计算的感觉,卡在某个数值
rn = Val(Text1.Text)
ri = Val(Text2.Text)
Select Case rn
Case Is >= 0, Is <= 25 Select Case ri
Case Is <= 50
Text3.Text = "一级"
Case Is > 50, Is <= 100
Text3.Text = "二级"
Case Is > 100
Text3.Text = "三级"
End Select
Case Is > 25, Is <= 50 Select Case ri
Case Is <= 25
Text3.Text = "一级"
Case Is > 25, Is <= 50
Text3.Text = "二级"
Case Is > 50, Is <= 100
Text3.Text = "三级"
Case Is > 100
Text3.Text = "四级"
End Select
Case Is > 50, Is <= 100 Select Case ri
Case Is <= 10
Text3.Text = "一级"
Case Is > 10, Is <= 25
Text3.Text = "二级"
Case Is > 25, Is <= 50
Text3.Text = "三级"
Case Is > 50, Is <= 100
Text3.Text = "四级"
Case Is > 100
Text3.Text = "四级"
End Select
Case Is > 100, Is <= 200 Select Case ri
Case Is <= 10
Text3.Text = "二级"
Case Is > 10, Is <= 25
Text3.Text = "三级"
Case Is > 25, Is <= 50
Text3.Text = "四级"
Case Is > 50, Is <= 100
Text3.Text = "四级"
Case Is > 100
Text3.Text = "五级"
End Select
Case Is > 200, Is <= 300 Select Case ri
Case Is <= 10
Text3.Text = "三级"
Case Is > 10, Is <= 25
Text3.Text = "四级"
Case Is > 25, Is <= 50
Text3.Text = "四级"
Case Is > 50, Is <= 100
Text3.Text = "五级"
Case Is > 100
Text3.Text = "五级"
End Select
Case Is > 300 Select Case ri
Case Is <= 10
Text3.Text = "四级"
Case Is > 10, Is <= 25
Text3.Text = "四级"
Case Is > 25, Is <= 50
Text3.Text = "五级"
Case Is > 50, Is <= 100
Text3.Text = "五级"
Case Is > 100
Text3.Text = "五级"
End Select
End Select
不知道哪出问题了,怎么很多数值没办法计算的感觉,卡在某个数值
解决方案 »
- 【放分加源码】VB6.0懒惰算法实现图像的高速模糊。
- 如何用combo+datagrid+adodc控件构造查询combo所选的记录
- 如何用CreatProgress函数成功启动command.com程序
- 100分求中文完全Win 32 API手册,分不够可以再加!!!
- 用ADO控件连接MYSQL数据库的具体过程是怎样的?在网上查了不少时间,现在还没连接上
- 为什么在com中的方法里不能用form作为参数传递?
- 程序里面如何取得internet配置,如果更改?
- 为什么注册 msado25.tlb 时从出错?
- 为什么我的对库操作均没有反应?
- 请教各位大神,有没有批量把每一行单元格的内容转换成一张jpg或者png图片的方法
- 请教高手,给一个VB导入导出SQL数据库中数据的例子?
- 字符串如何按照bcd码来运算
Private Sub Command1_Click()
rn = Val(Text1.Text)
ri = Val(Text2.Text)
Select Case rn
Case Is >= 0, Is <= 25
Select Case ri
Case Is <= 50
Text3.Text = "一级"
Case Is > 50, Is <= 100
Text3.Text = "二级"
Case Is > 100
Text3.Text = "三级"
End Select
Case Is > 25, Is <= 50
Select Case ri
Case Is <= 25
Text3.Text = "一级"
Case Is > 25, Is <= 50
Text3.Text = "二级"
Case Is > 50, Is <= 100
Text3.Text = "三级"
Case Is > 100
Text3.Text = "四级"
End Select
Case Is > 50, Is <= 100
Select Case ri
Case Is <= 10
Text3.Text = "一级"
Case Is > 10, Is <= 25
Text3.Text = "二级"
Case Is > 25, Is <= 50
Text3.Text = "三级"
Case Is > 50, Is <= 100
Text3.Text = "四级"
Case Is > 100
Text3.Text = "四级"
End Select
Case Is > 100, Is <= 200
Select Case ri
Case Is <= 10
Text3.Text = "二级"
Case Is > 10, Is <= 25
Text3.Text = "三级"
Case Is > 25, Is <= 50
Text3.Text = "四级"
Case Is > 50, Is <= 100
Text3.Text = "四级"
Case Is > 100
Text3.Text = "五级"
End Select
Case Is > 200, Is <= 300
Select Case ri
Case Is <= 10
Text3.Text = "三级"
Case Is > 10, Is <= 25
Text3.Text = "四级"
Case Is > 25, Is <= 50
Text3.Text = "四级"
Case Is > 50, Is <= 100
Text3.Text = "五级"
Case Is > 100
Text3.Text = "五级"
End Select
Case Is > 300
Select Case ri
Case Is <= 10
Text3.Text = "四级"
Case Is > 10, Is <= 25
Text3.Text = "四级"
Case Is > 25, Is <= 50
Text3.Text = "五级"
Case Is > 50, Is <= 100
Text3.Text = "五级"
Case Is > 100
Text3.Text = "五级"
End Select
End Select
End Sub
rn ri数值无论如何变大,都停留在二级位置
Case 0 to 25
'.......
Case 25 to 50
'......
Case 50 to 100
'......
Case 100 to 200
'......
Case 200 to 300
'......
Case 300
'......
End Select
End Sub
Case Is >= 0, Is <= 25 是或的关系,只要满足其中之一。你所有的值都大于等于 0, 所以一定走此路径。你可以将 Case 倒过来:Case Is > 300Case Is > 200Case Is > 100Case Is > 50Case Is > 25Case Else
Case Is >= 0, Is <= 25
***********************************
你所写的逻辑是错误的
假如 rn=60
会符合Is >= 0这个条件,这里就可以判断通过