Click to See Complete Forum and Search --> : Math


Moses420ca
September 21st, 2001, 06:40 PM
I need to know how to add, subtract, multiply and divide using vb5.0. I'm converting timer seconds into min.

http://www.geocities.com/moses420ca/images/thumbnails/drewblue2.jpgThankz, Drew
Moses420ca@yahoo.ca

Captain Nuss
September 22nd, 2001, 05:49 AM
Dim numberOne as Integer
Dim numberTwo as Integer
Dim result as Integer

Sub math()
numberOne = 5
numberTwo = 10

'Addition (result will be 5 + 10 = 15)
result = numberOne + numberTwo

'Substraction (result will be 10 - 5 = 5)
result = numberTwo - numberOne

'Division (result will be 10 / 5 = 2)
result = numberTwo / numberOne

'Multiplication (result will be 5 * 10 = 50)
result = numberOne * numberTwo
End Sub




----------------
You can contact me directly at Christoph.Schulze@gmx.co.uk
Hey, and... don't forget your parsley cause you can't eat your dog after having stolen him from some animal shelter and having drowned him in the Atlantic Ocean.

SAKYA
September 22nd, 2001, 06:59 AM
how ever if you are directly adding/substructing/multiplying two nubers in two textboxes you have to use the val function.


text3.text=val(text1.text)+val(text2.text)
text3.text=val(text1.text)-val(text2.text)
text3.text=val(text1.text)*val(text2.text)