lzth.net
当前位置:首页 >> VB中,以下CAsE语句中错误的是______. A.CAsE Is>... >>

VB中,以下CAsE语句中错误的是______. A.CAsE Is>...

A 错误! 因为 Case后面的表达式是一个或多个表达式的分界列表,比如: Case 1 To 4, 7 To 9, 11, 13, Is > MaxNumber A如果这样写语法上就对了: Case Is>10, Is10 或者 10 And Is10 And Is

select case int(x) //x取整 case is>=5,is

Private Sub Form_Click() Dim a As Integer a = InputBox("请输入一个数:") Select Case a Case Is > 0 MsgBox "是正数" Case Is < 0 MsgBox "是负数" Case Else MsgBox "是零" End Select End Sub

1.Select Case结构格式: Select Case e Case e1 'A组语句 Case e2 'B组语句 …… Case Else 'n组语句 End Select2.说明 e为测试表达式,可以是算术表达式或字符表达式,其值应是数字或字符型 e1、e2等是测试项,取值必须与测试表达式的值类型相同...

D B A D D A D D B A C D C C

Private Sub Command1_Click() Dim a As Integer a = Val(Text1.Text) Select Case a Case Is >= 100 Label3.Caption = "优" Case Is >= 80 Label3.Caption = "良" Case Is >= 60 Label3.Caption = "及格" Case Is < 60 Label3.Caption = "不及...

Select Case a Case 1, 3, 5 'a=1,3,5 Debug.Print "a等于1,3或者5" Case 8 To 12 '8

上面的写法本身就有问题,要想用一个语句处理多种case可以这样写:switch(a){ case 1: case 2: case 3: printf("我处理了a等于1,2,3的情况\n"); break; case 4: break; default: break;} 而对于提问者的写法,机器是这样理解的:假设a=0,那么...

select case [A1] case 1 [B1] = * case 2 [B1] =..... case ..... end select 你在讲程序还是讲 Excel 公式? 公式: =choose(A1,第一个值,第二个值,第三个值。。。。。。) =choose(A1,"A","B","C","D","E","F"......) 你讲的是 =1 2 3 4 5 ...

复制下面这段代码: Private Sub Form_Click() Dim a a = InputBox("请输入你要查看星期几的教师值班安排") Select Case a Case 1, 3, 5 MsgBox "星期一、三、五由张老师值班" Case 2, 4, 6 MsgBox "星期二、四、六由李老师值班" Case Else MsgBo...

网站首页 | 网站地图
All rights reserved Powered by www.lzth.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com