关于VB的问题,谢谢各位达人哈 Private Sub Command1_Click() Dim a As Integer Dim b As Integer Dim c As

PrivateSubCommand1_Click()DimaAsIntegerDimbAsIntegerDimcAsIntegerDimuAsSingleDimlAsSi... Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim u As Single
Dim l As Single
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
u! = 32.2
l! = 7.2
If a > u & b > u Then
c = u - l
ElseIf l > a & l > b Then
c = 0
ElseIf u > b & l < a Then
c = [6*(a+b-2l)] / 12
ElseIf u > b & l > a Then
c = [(b-l)^2/(b-a)] / 12
ElseIf u < b & l < a Then
c = [6(a+b-2l)/12] - [6(b-u)^2/(b-a)/12]
Else u < b & l > a
c = [6(b-l)^2/(b-a)] - [6(b-u)^2/(b-a)/12]
End If
展开
 我来答
当猪飞上天
2012-05-20 · 超过62用户采纳过TA的回答
知道小有建树答主
回答量:395
采纳率:0%
帮助的人:186万
展开全部
Private Sub Command1_Click()
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim u As Single
Dim l As Single
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
u! = 32.2
l! = 7.2
If a > u & b > u Then
c = u - l
ElseIf l > a & l > b Then
c = 0
ElseIf u > b & l < a Then
c = [6*(a+b-2l)] / 12
ElseIf u > b & l > a Then
c = [(b-l)^2/(b-a)] / 12
ElseIf u < b & l < a Then
c = [6(a+b-2l)/12] - [6(b-u)^2/(b-a)/12]
ElseIf u < b & l > a Then
c = [6(b-l)^2/(b-a)] - [6(b-u)^2/(b-a)/12]
End If
追问
先谢谢你的回答,但是我复制过去,运行的时候还是提示外部名未命名。然后光标就停在[6*(a+b-2l)] / 12这里了。不知道是哪里出问题了?
追答
Private Sub Command1_Click()
Dim a, b, c

Dim u As Single
Dim l As Single
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
u! = 32.2
l! = 7.2
If a > u & b > u Then
c = u - l
ElseIf l > a & l > b Then
c = 0
ElseIf u > b & l b & l > a Then
c = (b - l) ^ 2 / (b - a) / 12
ElseIf u a Then
c = 6 * (b - l) ^ 2 / (b - a) - 6 * (b - u) ^ 2 / (b - a) / 12
End If
End Sub
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式