关于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 展开
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 展开
1个回答
展开全部
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
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
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询