Code Download: http://www.schoolfreeware.com
This is Part 3 Simple Calculator
Data Parsing is more powerful than using VAL() STR(). The code for parsing is the datatype.parse
Examples
Integer.Parse
Single.Parse
Double.Parse
Error Handling:
Try
Code
Catch
Code
End Try
When there is an error, like typing "A" when a integer is expected will cause an error. The error is caught and the code within Catch is run.
what exactly is parsing?
EncloseMurcielago 1 month ago
You are the best teacher I have ever had! I love these videos. I am doing them one at a time and am loving this design environment. Microsoft should give you a huge chunk of funding cause I am going to buy VB and I am sure lots of others do too.
QuarkToo 1 month ago
@jayblink95
You can just use this code instead
TextBox1.Clear
TextBox2.Clear
And it will just clear it. :P
zygisrko 3 months ago
@SchoolFreeware PLEASE READ! Hi i was listening to your tutorial and i thought it was great, i decided to add to your Calculator and you might want to add this to any of your tutorials :)
It is basically the "A/C" button...
You create a button and change the text to "A/C" then you double click on it and edit the code. and paste this into the space :):
TextBox1.Text = "0"
TextBox2.Text = "0"
And it will bring both numbers back to default ("0")
Please Tell Me What You Think!!!!!!!!!!
jayblink95 3 months ago
How can I do if I put the invalid number and I want all of LabelAnswer, TextBoxN1 & TextBoxN2 to be clear. when error window poped up.
staffersteward 4 months ago in playlist Visual Basic 2010 Tutorials
This way make me more confuse
staffersteward 4 months ago in playlist Visual Basic 2010 Tutorials
@SuperMediaWizard yeah
YouMurderer019 5 months ago
Doing it this way is a big waste of time and can cause confusion. The point of a variable is to take something like "str(val(textboxnum1.Text) + val(textboxnum2.Text)) and turn that into something like "ans = one + two" It makes it simple, understandable and if needed, you can use it easily in several places. I'd hate to have to type "val(textboxnum1.text)" everyone time I wanted the val of the first box. It's so much easier to type "one".
Dornon2 5 months ago
@YouMurderer019 Yo??? Seriously???
SuperMediaWizard 5 months ago
Sorry
SuperMediaWizard 5 months ago