谁能解释一下我的问题,详细一点.
这是个计算器Dim num(1) As String
Dim flag As Byte
Dim operator
Private Sub Command1_Click(Index As Integer)
Label2.Caption = ""
Label1.Caption = Label1.Caption & Index
num(flag) = num(flag) & Index
End Sub
Private Sub Command2_Click(Index As Integer)
If num(0) = "" Then Exit Sub
num(0) = Label1.Caption
Select Case Index
Case 0: Label1.Caption = Label1.Caption & "+"
Case 1: Label1.Caption = Label1.Caption & "-"
Case 2: Label1.Caption = Label1.Caption & "*"
Case 3: Label1.Caption = Label1.Caption & "/"
End Select
operator = Index
flag = 1
For i = 0 To 3
Command2(i).Enabled = False
Next
End Sub
Private Sub Command3_Click()
On Error GoTo out‘这个语法怎么理解
Select Case operator
Case 0: Label2.Caption = CLng(num(0)) + CLng(num(1))'clng是什么意思
Case 1: Label2.Caption = CLng(num(0)) - CLng(num(1))
Case 2: Label2.Caption = CLng(num(0)) * CLng(num(1))
Case 3: Label2.Caption = CLng(num(0)) / CLng(num(1))
End Select
Label2.Caption = "=" & Label2.Caption
For i = 0 To 1
num(i) = ""
Next
flag = o
out:
End Sub
Private Sub Command4_Click()
Label1.Caption = ""
Label2.Caption = ""
For i = 0 To 3
Command2(i).Enabled = True
Next
End Sub
Private Sub Form_Load()
num(0) = ""
num(1) = ""
flag = 0 '这个起到什么作用,
End Sub