急~~~~请大虾帮忙解释下下面的程序,越详细越好!!!

来源:百度知道 编辑:UC知道 时间:2024/06/28 06:19:16
Dim dflag As Integer
Dim i As Integer
Dim opnre As Integer
Dim prev As Double
Dim oflag As Integer
Dim ind As Integer
Private Sub Command1_Click(Index As Integer)
If ind = 4 Then
prev = 0
Text1.Text = " "
ind = 0
End If
opnre = 0
If oflag = 0 Then
Text1.Text = " "
End If
oflag = 1
If Command1(Index).Caption <> "." Then
If Text1.Text <> " 0" Then
Text1.Text = Text1.Text & Command1(Index).Caption
Else
Text1.Text = " " & Command1(Index).Caption
End If
Else
If dflag = 0 Then
Text1.Text = Text1.Text & "."
dflag = 1
Else
MsgBox ("ILLEGAL SAIRAM")
End If

Dim dflag As Integer
Dim i As Integer
Dim opnre As Integer
Dim prev As Double
Dim oflag As Integer
Dim ind As Integer
以上为:定义变量为整数型变量
Private Sub Command1_Click(Index As Integer) !单击Command1,执行以下命令:
If ind = 4 Then !当变量ind=4,执行如下命令
prev = 0 !给prev变量赋值0
Text1.Text = " " !清空text1
ind = 0 !给ind变量赋值0
End If !结束判断
opnre = 0 !给变量opnre辅初值0
If oflag = 0 Then !判断
Text1.Text = " "
End If
oflag = 1 !给变量oflag辅初值0
If Command1(Index).Caption <> "." Then !若按钮index的标题不为‘.’
If Text1.Text <> " 0" Then !若text1中数据非0
Text1.Text = Text1.Text & Command1(Index).Caption !设置text1中数据为原数据Text1.Text +按钮index的标题
Else !否则
Text1.Text = " " & Command1(Index).Caption !设置text1中数据
End If
Else
If dflag = 0 Then !判断
Text1.Text = Text1.Text & "." !设置text1中数据
df