Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Visual Basic 2010 Express Tutorial 6 - Data Parsing Error Checking and An User Friendly Interface

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
39,844
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jul 12, 2010

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.

  • likes, 1 dislikes

Link to this comment:

Share to:
see all

All Comments (47)

Sign In or Sign Up now to post a comment!
  • what exactly is parsing?

    

  • 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.

  • @jayblink95

    You can just use this code instead

    TextBox1.Clear

    TextBox2.Clear

    And it will just clear it. :P

  • @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!!!!!!!!!!

  • 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.

  • This way make me more confuse

  • 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".

  • @YouMurderer019 Yo??? Seriously???

    

  • Sorry

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more