Private Sub Command2_Click(Index As Integer)
Select Case Index
Case 0
If Not pointFlag Then
If firstN Then
strN1 = "0."
firstN = False
Else: strN1 = strN1 + "0."
End If
Else
Exit Sub
End If
pointFlag = True
Text1.Text = strN1
Case 1
If Sgn(Val(strN1)) = 1 Then
strN1 = "-" + strN1
Else
If Sgn(Val(strN1)) = -1 Then
strN1 = Right(strN1, Len(strN1) - 1)
End If
Text1.Text = strN1
Case 2 To 5
firstN = True
pointFlag = False
If SignFlag Then
Call run
Else
SignFlag = True
strN2 = strtN1
strN1 = ""
End If
Runsign = idex - 1
End Select
End Sub
Select Case Index
Case 0
If Not pointFlag Then
If firstN Then
strN1 = "0."
firstN = False
Else: strN1 = strN1 + "0."
End If
Else
Exit Sub
End If
pointFlag = True
Text1.Text = strN1
Case 1
If Sgn(Val(strN1)) = 1 Then
strN1 = "-" + strN1
Else
If Sgn(Val(strN1)) = -1 Then
strN1 = Right(strN1, Len(strN1) - 1)
End If
Text1.Text = strN1
Case 2 To 5
firstN = True
pointFlag = False
If SignFlag Then
Call run
Else
SignFlag = True
strN2 = strtN1
strN1 = ""
End If
Runsign = idex - 1
End Select
End Sub
你可以把case块逐个注释掉
用排除法肯定能找到问题
有可能问题出在if……else块上
Private Sub Command2_Click(Index As Integer)
Select Case Index
Case 0
If Not pointFlag Then
If firstN Then
strN1 = "0."
firstN = False
Else
strN1 = strN1 + "0."
End If
Else
Exit Sub
End If
pointFlag = True
Text1.Text = strN1
Case 1
If Sgn(Val(strN1)) = 1 Then
strN1 = "-" + strN1
Else
If Sgn(Val(strN1)) = -1 Then
strN1 = Right(strN1, Len(strN1) - 1)
End If
Text1.Text = strN1
Case 2 To 5
firstN = True
pointFlag = False
If SignFlag Then
Call run
Else
SignFlag = True
strN2 = strtN1
strN1 = ""
End If
Runsign = idex - 1
End Select
End Sub