Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'By HugoTheBaws @ nulled.io
- Try ' a try statement will try to do what's below
- Dim num01 As Double ' we dimension num01 as a double, double is a number that contains decimals (ex : 9,32718), while an Integer is a number that does not contain decimals (ex: 10)
- Dim num02 As Double ' same thing we did for num01, but this time using num02
- Dim ans As Double ' ans is going to be our answer, we will need to dimension as double and not as integer for very accurate results
- num01 = num1TXT.Text ' tells num01 that its value is what is written in the 1st textbox
- num02 = num2TXT.Text ' tells num02 that its value is what is written in the 2nd textbox
- If plus.Checked = True Then ' if statement, if the radiobutton "plus" ( + ) is checked, the ans will be num01 + num02
- ans = num01 + num02
- ElseIf minus.Checked = True Then ' if its not that, it will jump into this statement which will do num01 - num02
- ans = num01 - num02
- ElseIf multiply.Checked = True Then ' this time ans = num01 x num02
- ans = num01 * num02
- ElseIf divide.Checked = True Then ' and finally this will make ans be num01 divided by num02
- ans = num01 / num02
- End If
- 'if statment ended right here
- ansTXT.Text = ans ' basically tells the 3rd textbox that its value is ans
- Catch ex As Exception 'if try statment catches ex as an exception (ex can be replaced by other name, this is the default one)
- MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Unhandled exception!") ' pops up a messagebox saying what exception has ocurred
- End Try
Advertisement
Add Comment
Please, Sign In to add comment