|
-
May 16th, 2003, 04:42 PM
#1
Thread Starter
Junior Member
Simple Math Functions
Hey, I'm kind of new kind of not to programing, I know basic syntax's and all that, but for some reason I can't get a simple addition function to work. I'm trying to make a very simple calculator for my first project. It irretates me so much that subtraction, multiplication, division all work but not addition. It does 1+1=11, 25+4=254, etc... Any help? Here's the code:
Private Sub Add_bttn_Click()
Numb_3 = Numb_1 + Numb_2
End Sub
Private Sub Div_Bttn_Click()
Numb_3 = Numb_1 / Numb_2
End Sub
Private Sub Mul_Bttn_Click()
Numb_3 = Numb_1 * Numb_2
End Sub
Private Sub Sub_Bttn_Click()
Numb_3 = Numb_1 - Numb_2
End Sub
Look through your dreams through a mirror,
-
Jun 6th, 2003, 02:53 PM
#2
Declare numb_1 , numb_2 and numb_3 as integers. The problem will (should) be solved
-
Jun 6th, 2003, 03:04 PM
#3
Hyperactive Member
I think the following should work as well:
Numb_3 = VAL(Numb_1)+VAL(Numb_2)
-
Jun 10th, 2003, 10:39 AM
#4
Lively Member
Try this:
Code:
Function Add(Num1, Num2)
Num3 = Num1 + Num2
Return Num3
End Function
My syntax is probably screwed up, due to the fact that I don't have anything to write it in.
ERROR: No keyboard detected. Hit F1 to continue.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|