我的VB6出错

下面步骤哪错了?请教高手.PrivateSubCommand1_Click()DimpbsAsSinglepbs=b*b-4*a*cIfpbs>0Thenpbs=Sqr(... 下面步骤哪错了?请教高手.
Private Sub Command1_Click()
Dim pbs As Single
pbs = b * b - 4 * a * c
If pbs > 0 Then
pbs = Sqr(pbs)
Text4 = Format((-b + pbs) / 2 / a, "0.00")
Text5 = Format((-b - pbs) / 2 / a, "0.00")
ElseIf pbs = 0 Then
Text4 = Format(-b / 2 / a, "0.00")
Text5 = Format(-b / 2 / a, "0.00")
Else
pbs = Sqr(-pbs)
Text4 = Format((-b + pbs) / 2 / a, "0.00") + "+i"
Text5 = Format((-b + pbs) / 2 / a, "0.00") + "-i"
End If
End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Command3_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text1.SetFocus
End Sub

Private Sub Text1_LostFocus()
If Text1 <> "" And Not IsNumeric(Text1) Then
Text1 = ""
Text1.SetFocus
Else
a = Text1
End If
End Sub

Private Sub Text2_LostFocus()
If Text2 <> "" And Not IsNumeric(Text2) Then
Text2 = ""
Text2.SetFocus
Else
b = Text2
End If
End Sub

Private Sub Text3_LostFocus()
If Text3 <> "" And Not IsNumeric(Text3) Then
Text3 = ""
Text3.SetFocus
Else
c = Text3
End If
End Sub
在哪补充呢?
展开
 我来答
百度网友8694d7544
2007-07-01 · TA获得超过279个赞
知道小有建树答主
回答量:113
采纳率:0%
帮助的人:153万
展开全部
Command1_Click过程中未对a,b,c定义及赋值。不定义没关系,但不赋值就没法子算。
Private Sub Command1_Click()
Dim pbs As Single后
加入
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

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

类别

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

说明

0/200

提交
取消

辅 助

模 式