主题:请老鸟指点下!
我很郁闷的 怎么都不知道哪里出错了!麻烦哪位大哥指点一下 谢谢!
很简单的小计算器程序,就是最后的等于总是输不出来
[img]http://b38.photo.store.qq.com/http_imgload.cgi?/rurl4_b=a67f9fe64ea0282aee3a80b356c6c04b8545f1e8fcd87f28196021bcbc972fe012112c211f468917371f1005576ccae5d309d85ddb179f9afd978301b143b9403205b02589e4831055592f404dc4fd43c27ed8c8&a=38&b=38[/img]
Private Sub Command1_Click()
a = Val(Text1.Text)
Text1.Text = ""
q = 1
End Sub
Private Sub Command2_Click()
a = Val(Text1.Text)
Text1.Text = ""
w = 1
End Sub
Private Sub Command3_Click()
a = Val(Text1.Text)
Text1.Text = ""
e = 1
End Sub
Private Sub Command4_Click()
a = Val(Text1.Text)
Text1.Text = ""
r = 1
End Sub
Private Sub Command5_Click()
b = Val(Text1.Text)
If q = 1 Then
c = a + b
ElseIf w = 1 Then
c = a - b
ElseIf e = 1 Then
c = a * b
ElseIf r = 1 Then
c = a / b
End If
Text1.Text = c
End Sub
Private Sub Form_Load()
Dim a As Single, b As Single, c As Single, q As Single, w As Single, e As Single, r As Single
Text1.Text = ""
q = 0
w = 0
e = 0
r = 0
End Sub
很简单的小计算器程序,就是最后的等于总是输不出来
[img]http://b38.photo.store.qq.com/http_imgload.cgi?/rurl4_b=a67f9fe64ea0282aee3a80b356c6c04b8545f1e8fcd87f28196021bcbc972fe012112c211f468917371f1005576ccae5d309d85ddb179f9afd978301b143b9403205b02589e4831055592f404dc4fd43c27ed8c8&a=38&b=38[/img]
Private Sub Command1_Click()
a = Val(Text1.Text)
Text1.Text = ""
q = 1
End Sub
Private Sub Command2_Click()
a = Val(Text1.Text)
Text1.Text = ""
w = 1
End Sub
Private Sub Command3_Click()
a = Val(Text1.Text)
Text1.Text = ""
e = 1
End Sub
Private Sub Command4_Click()
a = Val(Text1.Text)
Text1.Text = ""
r = 1
End Sub
Private Sub Command5_Click()
b = Val(Text1.Text)
If q = 1 Then
c = a + b
ElseIf w = 1 Then
c = a - b
ElseIf e = 1 Then
c = a * b
ElseIf r = 1 Then
c = a / b
End If
Text1.Text = c
End Sub
Private Sub Form_Load()
Dim a As Single, b As Single, c As Single, q As Single, w As Single, e As Single, r As Single
Text1.Text = ""
q = 0
w = 0
e = 0
r = 0
End Sub