This document contains code for a basic calculator application. It defines variables to store numbers and operations. It includes subroutines for number buttons 0-9 and operation buttons like addition, subtraction, multiplication and division. The number button subroutines add the corresponding number to the display field. The operation button subroutines set the operation variable and clear the display field in preparation for the next number entry.
This document contains code for a basic calculator application. It defines variables to store numbers and operations. It includes subroutines for number buttons 0-9 and operation buttons like addition, subtraction, multiplication and division. The number button subroutines add the corresponding number to the display field. The operation button subroutines set the operation variable and clear the display field in preparation for the next number entry.
This document contains code for a basic calculator application. It defines variables to store numbers and operations. It includes subroutines for number buttons 0-9 and operation buttons like addition, subtraction, multiplication and division. The number button subroutines add the corresponding number to the display field. The operation button subroutines set the operation variable and clear the display field in preparation for the next number entry.
Dim OPR As Integer Private Sub igual_Click() Private Sub resta_Click()
Dim AUX1 As Integer AUX2 = Val(N) AUX1 = Val(N)
Dim AUX2 As Integer If OPR = 1 Then OPR = 2
N = AUX1 + AUX2 N = ""
Private Sub AC_Click() ElseIf OPR = 2 Then N.SetFocus N = "" N = AUX1 - AUX2 End Sub N.SetFocus ElseIf OPR = 3 Then End Sub Private Sub seis_Click() N = AUX1 * AUX2 N.Text = N.Text & 6 Private Sub cero_Click() ElseIf OPR = 4 Then End Sub N.Text = N.Text & 0 N = AUX1 / AUX2 End Sub Private Sub siete_Click() End If N.Text = N.Text & 7 Private Sub cinco_Click() End Sub End Sub N.Text = N.Text & 5 Private Sub End Sub multiplicasion_Click() Private Sub suma_Click()
AUX1 = Val(N) AUX1 = Val(N)
Private Sub cuatro_Click() OPR = 3 OPR = 1 N.Text = N.Text & 4 N = "" N = "" End Sub N.SetFocus End Sub Private Sub division_Click() End Sub Private Sub tres_Click() AUX1 = Val(N) Private Sub nueve_Click() N.Text = N.Text & 3 OPR = 4 N.Text = N.Text & 9 End Sub N = ""
N.SetFocus End Sub Private Sub uno_Click()
End Sub Private Sub ocho_Click() N.Text = N.Text & 1