为什么这个程序中的计算结果不对呢,就是第一次正确,之后就会出现运算错误,Dim a As Boolean,num(1) As String,cou As Byte,operatorPrivate Sub Command1_click(Index As Integer)If a ThenLabel3.Caption = ""Label4.Caption = ""a =
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/01 23:07:46
![为什么这个程序中的计算结果不对呢,就是第一次正确,之后就会出现运算错误,Dim a As Boolean,num(1) As String,cou As Byte,operatorPrivate Sub Command1_click(Index As Integer)If a ThenLabel3.Caption =](/uploads/image/z/2617416-0-6.jpg?t=%E4%B8%BA%E4%BB%80%E4%B9%88%E8%BF%99%E4%B8%AA%E7%A8%8B%E5%BA%8F%E4%B8%AD%E7%9A%84%E8%AE%A1%E7%AE%97%E7%BB%93%E6%9E%9C%E4%B8%8D%E5%AF%B9%E5%91%A2%2C%E5%B0%B1%E6%98%AF%E7%AC%AC%E4%B8%80%E6%AC%A1%E6%AD%A3%E7%A1%AE%2C%E4%B9%8B%E5%90%8E%E5%B0%B1%E4%BC%9A%E5%87%BA%E7%8E%B0%E8%BF%90%E7%AE%97%E9%94%99%E8%AF%AF%2CDim+a+As+Boolean%2Cnum%281%29+As+String%2Ccou+As+Byte%2CoperatorPrivate+Sub+Command1_click%28Index+As+Integer%29If+a+ThenLabel3.Caption+%3D+%22%22Label4.Caption+%3D+%22%22a+%3D)
为什么这个程序中的计算结果不对呢,就是第一次正确,之后就会出现运算错误,Dim a As Boolean,num(1) As String,cou As Byte,operatorPrivate Sub Command1_click(Index As Integer)If a ThenLabel3.Caption = ""Label4.Caption = ""a =
为什么这个程序中的计算结果不对呢,就是第一次正确,之后就会出现运算错误,
Dim a As Boolean,num(1) As String,cou As Byte,operator
Private Sub Command1_click(Index As Integer)
If a Then
Label3.Caption = ""
Label4.Caption = ""
a = False
End If
If Index 10 Then
Label3.Caption = Label3.Caption & Index
num(cou) = num(cou) & Index
Else
Label3.Caption = Label3.Caption & "."
num(cou) = num(cou) & "."
Command1(10).Enabled = False
End If
End Sub
Private Sub Command2_click(Index As Integer)
If num(0) = "" Then Exit Sub
Select Case Index
Case 0:Label3.Caption = Label3.Caption & "+"
Case 1:Label3.Caption = Label3.Caption & "-"
Case 2:Label3.Caption = Label3.Caption & "*"
Case 3:Label3.Caption = Label3.Caption & "/"
End Select
operator = Index
cou = 1
For i = 0 To 3
Command2(i).Enabled = False
Next
Command1(10).Enabled = True
End Sub
Private Sub Command3_Click()
a = True
On Error GoTo a0
Select Case operator
Case 0
Label4.Caption = Val(num(0)) + Val(num(1))
Case 1
Label4.Caption = Val(num(0)) - Val(num(1))
Case 2
Label4.Caption = Val(num(0)) * Val(num(1))
Case 3
Label4.Caption = Val(num(0)) / Val(num(1))
End Select
For i = 0 To 3
Command2(i).Enabled = True
Next
cou = 0
Command1(10).Enabled = True
a0:
Exit Sub
End Sub
Private Sub Command4_Click()
Form2.Show
End Sub
Private Sub Form_Load()
setpicture = LoadPicture("9056820108141597682_w_.jpg")
num(0) = ""
num(1) = ""
cou = 0
a = True
End Sub
为什么这个程序中的计算结果不对呢,就是第一次正确,之后就会出现运算错误,Dim a As Boolean,num(1) As String,cou As Byte,operatorPrivate Sub Command1_click(Index As Integer)If a ThenLabel3.Caption = ""Label4.Caption = ""a =
你猜