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

Visual Basic Tutorial - #2 - Euro/Dollar Converter Machine

Loading...

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

Uploaded by on Sep 8, 2010

This Visual Basic tutorial is for beginners and starters of the language.

My second visual basic tutorial that will show us some new things to use in our script like notes, some new variables and how to keep things nice and tidy.

We're creating a nice application that will allow us to convert Dollars to Euros and the other way around.


Please rate and subscribe for more video's! Also leave a comment or ask some questions if you want.

So, let's try it out!


---ASSIGNMENT - SPOILER ----

Private Sub cmdDollar_Click()



'Declaring the value's
Dim DollarS As String
Dim Dollar As Double
Dim EuroS As String
Dim Euro As Double

'Reading the screen
EuroS = txtEuro.Text
Euro = Val(EuroS)

'Calculate
Dollar = Euro * 1.2
'Write to screen
DollarS = Str(Dollar)
txtDollar.Text = DollarS

End Sub

Private Sub cmdEuro_Click()



'Declaring the value's
Dim DollarS As String
Dim Dollar As Double
Dim EuroS As String
Dim Euro As Double

'Reading the screen
DollarS = txtDollar.Text
Dollar = Val(DollarS)

'Calculate
Euro = Dollar * 0.788705734

'Write to screen
EuroS = Str(Euro)
txtEuro.Text = EuroS

End Sub

  • likes, 3 dislikes

Link to this comment:

Share to:

Uploader Comments (TeachMeUp)

  • You don't need extra code, you can modify the code as the following for simplicity. Private Sub cmdDollar_Click() 'Declaring the value's Dim Dollar As Double Dim Euro As Double 'Reading the screen Dollar = txtDollar.Text 'Calculate Euro = Dollar * 0.788705734 'Write to screen txtEuro.Text = Euro End Sub
  • @AndyBCankaya Ofcourse! That's exactly what is happening without my other steps! But I've used the longer extra code to show that you can store and move the information in the variables to other variables and play around with them. In other longer and complicated scripts where you have to use diffrent value's for different variables the short example you have used wouldn't work. But you're right! In this program your version of the code would be better, but to learn the language I do prefer mine

see all

All Comments (9)

Sign In or Sign Up now to post a comment!
  • you are a very good teacher. Thank you

  • great tutorial. keep going on ;)

  • best tut ever

  • dude zo een lelijke nederlandse accent

  • When I try to do

    Dim DollarS As string

    Dim Dollar As double I get a error that it is an unused variable. How do I fix this error?

  • This video is much better than the first one tbh, keep it up!!

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