The code is as follows:
Copy Code code as follows:
/**
*author: Black Bird Heart
*version:1.0
*/
Dim IntX as Double global variable, for storing calculated values
Dim intoperation as Double ' tag operation type
Dim Isbegin as Boolean ' tag has been assigned to Intx
Public Sub Clear () Empty command function
Screen. Caption = ""
End Sub
Public Sub Savatointx ()
Select Case Intoperation
Case 1 ' addition
If Isbegin = False Then
IntX = Val (screen. Caption)
Isbegin = True
Else
IntX = IntX + Val (screen. Caption)
End If
Case 2 ' subtraction
If Isbegin = False Then
IntX = Val (screen. Caption)
Isbegin = True
Else
IntX = intx-val (screen. Caption)
End If
Case 3 ' multiplication
If Isbegin = False Then
IntX = Val (screen. Caption)
Isbegin = True
Else
IntX = IntX * Val (screen. Caption)
' Screen. Caption = IntX
End If
Case 4 ' Division
If Isbegin = False Then
IntX = Val (screen. Caption)
Isbegin = True
Else
IntX = intx/val (screen. Caption)
End If
End Select
End Sub
Private Sub Command0_click ()
Screen. Caption = screen. Caption & 0
End Sub
Private Sub Command1_Click ()
Screen. Caption = screen. Caption & 1
End Sub
Private Sub Command2_Click ()
Screen. Caption = screen. Caption & 2
End Sub
Private Sub Command3_Click ()
Screen. Caption = screen. Caption & 3
End Sub
Private Sub Command4_click ()
Screen. Caption = screen. Caption & 4
End Sub
Private Sub Command5_click ()
Screen. Caption = screen. Caption & 5
End Sub
Private Sub Command6_click ()
Screen. Caption = screen. Caption & 6
End Sub
Private Sub Command7_click ()
Screen. Caption = screen. Caption & 7
End Sub
Private Sub Command8_click ()
Screen. Caption = screen. Caption & 8
End Sub
Private Sub Command9_click ()
Screen. Caption = screen. Caption & 9
End Sub
Private Sub Commandclear_click () ' Empty command '
Isbegin = False
intoperation = 0
IntX = 0
Screen. Caption = ""
End Sub
Private Sub Commandequal_click () ' equal sign operation
If intoperation <> 0 Then ' There is an operational mark of the case
Call Savatointx
intoperation = 0
Isbegin = False
Screen. Caption = IntX
End If
End Sub
Private Sub Commandminus_click () ' subtraction operation
If intoperation <> 0 Then ' There is an operational mark of the case
Call Savatointx
Intoperation = 2
Call Clear
Else
Intoperation = 2
Call Savatointx
Call Clear
End If
End Sub
Private Sub Commandmultiple_click () ' multiplication operations
If intoperation <> 0 Then ' There is an operational mark of the case
Call Savatointx
Intoperation = 3
Call Clear
Else
Intoperation = 3
Call Savatointx
Call Clear
End If
End Sub
Private Sub Commandplus_click () ' addition operation
If intoperation <> 0 Then ' There is an operational mark of the case
Call Savatointx
Intoperation = 1
Call Clear
Else
Intoperation = 1
Call Savatointx
Call Clear
End If
End Sub
Private Sub Commandslash_click () ' Division operation
If intoperation <> 0 Then ' There is an operational mark of the case
Call Savatointx
Intoperation = 4
Call Clear
Else
Intoperation = 4
Call Savatointx
Call Clear
End If
End Sub