帮我解释一下这个VB代码

来源:百度知道 编辑:UC知道 时间:2024/06/01 07:35:09
帮我解释这个vb代码。

Dim a, b, c, d, e As Integer
Private Sub Command1_Click(Index As Integer)
If b = 0 Then
Label1.Caption = " "
End If

b = 1
If Command1(Index).Caption <> "" Then
If Label1.Caption <> "0" Then
Label1.Caption = Label1.Caption & Command1(Index).Caption
Else
Label1.Caption = " " & Command1(Index).Caption
End If
Else
If e = 0 Then
Label1.Caption = Label1.Caption & "."
End If
End If
End Sub

Private Sub Command2_Click(Index As Integer)
If a = 0 Then
c = c + Val(Label1.Caption)
ElseIf a = 1 Then
c = c - Val(Label1.Caption)
ElseIf a = 2 Then
If Val(Label1.Caption) = 0 Then
Exit Sub
Else
c = c / Val(Label1.Caption)

Dim a, b, c, d, e As Integer 声明5个整形变量
Private Sub Command1_Click(Index As Integer) 按扭控件数组1的单击事件
If b = 0 Then 如果b=0,那么
Label1.Caption = " " 标签1中的内容清空
End If 结束一个IF语句

b = 1 之后,给b赋植为1
If Command1(Index).Caption <> "" Then 如果当前选中按扭控件数组1的显示内容不为空 , 那么
If Label1.Caption <> "0" Then (继续判断)如果标签1的显示文字不为0
Label1.Caption = Label1.Caption & Command1(Index).Caption 那么,标签1的显示内容为原来的内容再加所选按扭控件数

组的显示内容
Else 反之,也就是说如果标签1的显示文字为0
Label1.Caption = " " & Command1(Index).Caption 标签1的内容为所选按扭控件数组1的显示内容

End If