Ads 468x60px

.

Working with Variables

Now that the whirlwind tours are out of the way, it’s time to drill into the details of Visual Basic 2005 Express. The fundamental thing that every single line of code you write will ever do is work with data—not the big scary database kind of data, but small lumps of  data. If you’re adding a screen to your program to handle logging in, for example, you’llwant to work with the username and password that the user enters. That’s the kind of data I’m talking about.

The proper name for this kind of stuff is variables. Variables are places in your program code that you create to store and work with data while your program is running (as opposed to databases, which store data for as long as you need them to). In this chapter you’ll take a look at just how to set up and use variables. Instead of getting too technical, I’m going to focus on the stuff that you’ll want to do every day. For example, how do you store a number and work on it? What about text? How do you convert one type of data to another (numbers to text and vice versa, for example)?

The topics we’ll cover in this chapter are the fundamentals of Visual Basic, the foundations, if you like, on which you’ll build your future magnificent applications.

  • The Basic Basics
    • Numbers
    • Integers
  • Other Number Types
  • Boolean Values
  • Characters and Text 
  • Arrays
  • Making Decisions
    • If Statements
    • Select Statements