VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Easy Math

by Demian Net (14 Submissions)
Category: Math/Dates
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (4 Votes)

Do math, add, subtract, multiply, divide

API Declarations
Option Explicit

Public Sub Multiply(X As Integer, Y As Integer)
Dim Z
Z = X * Y
Text3.Text = Str(Z)
End Sub

Public Sub Subtract(X As Integer, Y As Integer)
Dim Z
Z = X - Y
Text3.Text = Str(Z)
End Sub

Public Sub Add(X As Integer, Y As Integer)
Dim Z
Z = X + Y
Text3.Text = Str(Z)
End Sub

Public Sub Divide(X As Integer, Y As Integer)
Dim Z
Z = X / Y
Text3.Text = Str(Z)
End Sub

Rate Easy Math

'Make a Command1
 'Make a Text1
 'Make a Text2
 'Make a Text3 (Locked)
 
 'Add
 Private Sub Command1_Click() 
 Add Text1, Text2 
 End Sub 
 
 'Subtract
 Private Sub Command1_Click() 
 Subtract Text1, Text2 
 End Sub 
 
 'Multiply
 Private Sub Command1_Click() 
 Multiply Text1, Text2 
 End Sub 
 
 'Divide
 Private Sub Command1_Click() 
 Divide Text1, Text2 
 End Sub 

Download this snippet    Add to My Saved Code

Easy Math Comments

No comments have been posted about Easy Math. Why not be the first to post a comment about Easy Math.

Post your comment

Subject:
Message:
0/1000 characters