VB里提示实时错误"6"
DimaAsIntegerDimbAsIntegerDimcAsIntegerDimdAsIntegerPrivateSubCommand1_Click()SelectC...
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
Private Sub Command1_Click()
Select Case Combo1.Text
Case "铜"
a = 390
Case "钢铁"
a = 450
Case "花岗岩"
a = 800
Case "铝"
a = 900
Case "石蜡"
a = 2500
Case "干燥泥土"
a = 840
Case "水银"
a = 140
Case "煤油"
a = 2100
Case "甘油"
a = 2200
Case "酒精"
a = 2400
Case "水"
a = 4200
Case "冰"
a = 2100
End Select
b = Val(Text1.Text)
c = Val(Text2.Text)
d = a * b * c '这里提示错误
Text3.Text = Str(d)
End Sub
Private Sub Form_Load()
Combo1.AddItem "铜"
Combo1.AddItem "钢铁"
Combo1.AddItem "花岗岩"
Combo1.AddItem "铝"
Combo1.AddItem "石蜡"
Combo1.AddItem "干燥泥土"
Combo1.AddItem "水银"
Combo1.AddItem "煤油"
Combo1.AddItem "甘油"
Combo1.AddItem "酒精"
Combo1.AddItem "水"
Combo1.AddItem "冰"
End Sub
怎么解决? 展开
Dim b As Integer
Dim c As Integer
Dim d As Integer
Private Sub Command1_Click()
Select Case Combo1.Text
Case "铜"
a = 390
Case "钢铁"
a = 450
Case "花岗岩"
a = 800
Case "铝"
a = 900
Case "石蜡"
a = 2500
Case "干燥泥土"
a = 840
Case "水银"
a = 140
Case "煤油"
a = 2100
Case "甘油"
a = 2200
Case "酒精"
a = 2400
Case "水"
a = 4200
Case "冰"
a = 2100
End Select
b = Val(Text1.Text)
c = Val(Text2.Text)
d = a * b * c '这里提示错误
Text3.Text = Str(d)
End Sub
Private Sub Form_Load()
Combo1.AddItem "铜"
Combo1.AddItem "钢铁"
Combo1.AddItem "花岗岩"
Combo1.AddItem "铝"
Combo1.AddItem "石蜡"
Combo1.AddItem "干燥泥土"
Combo1.AddItem "水银"
Combo1.AddItem "煤油"
Combo1.AddItem "甘油"
Combo1.AddItem "酒精"
Combo1.AddItem "水"
Combo1.AddItem "冰"
End Sub
怎么解决? 展开
4个回答
展开全部
变量溢出 把D改为Long
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你把Dim d As Integer改为Dim d As long
如果还有的话只能用高精度了……
如果还有的话只能用高精度了……
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
把dim d as integer
改为:
Dim d as double
改为:
Dim d as double
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询