写到小数点部分,调试运行就错误了,请教各位代码错在那里了!不知道是不是变量的地方错误了。小弟初学
望高手指正!感激不尽!
Option Explicit
Dim Num1, Num2 As Single
Dim strNum1, strNum2 As String
Dim FirstNum As Boolean
Dim PointFlag As Boolean
Private Sub Command1_Click(Index As Integer)
Select Case Index
Case 0 To 9
If FirstNum Then
strNum1 = Str(Index)
FirstNum = False
Else
strNum1 = strNum1 + Str(Index)
End If
Label1.Caption = strNum1
Case10
If Not PointFlag Then
strNum1 = "0"
FirstNum = False
Else
strNum1 = strNum1 + "."
End If
Else
Exit Sub
End If
PointFlag = True
Label1.Caption = strNum1
End Select
End Sub
Private Sub Form_Load()
Num1 = 0
Num2 = 0
strNum1 = ""
strNum2 = ""
FirstNum = True
PointFlag = False
End Sub