Part 1: Start Here!
If you're new to Visual Basic, or even new to programming, this is the place! Visual Basic from the very ground up will be explained. Those of you who are more code-wise might find this article slightly boring from a technical perspective ... but Hey!, you're welcome here too!
The first thing you need to know, and I mean know, about programming is that it's not magic and you can do it. The people who have trouble learning to program are the ones who expect to have trouble. If you think it's going to be easy, it probably will be for you. So plan on having fun! It's the best way to learn.
The second thing is to realize is that the computer is really dumb! I mean stupid, idiotic, and just plain dense. That's why it has to be told each and every thing to do ... at some time. The TV and movie plots where the computer is this scheming, thinking, entity are completely wrong. If a computer doesn't have instructions to do something, it will not do anything. Your task as a programmer is to provide those instructions. The flip side of this is that if it's not doing what you intend, then it's because the instructions that it was given were wrong.
The main flaw in this is that YOU don't give the computer all of the instructions. It gets a lot of them from other programmers at other times in the form of software like the compiler (the program that turns a 'programming language' like Visual Basic into instructions that the computer can actually understand), the operating system (the program that turns things like your keystrokes into instructions that the computer can actually understand), and software objects (little packages of self contained program code that do things that a lot of people need). So to really understand the instructions that the computer received, you have to have an idea about what all the other instructions are. Welcome to programming!
Therefore ... our task in learning Visual Basic is to understand how Visual Basic combines with your instructions (and all the other stuff) to form a complete program.
Fortunately, Visual Basic takes care of virtually all of the details for you. But it's a good idea to know what's happening "under the covers". Here's a picture of what all this looks like.
By the way, this is usually called a 'Flow Chart'. A lot of people insist that you draw a flow chart of any program before you try to write it. It's a good idea, especially for people just starting out. But remember rule number 1: If it's not fun, don't do it.
Part 2: The Visual Basic Programming Environment
As the previous flowchart showed, you have to have the Basic software before you can complete a working program. The good news is that Microsoft does provide a first class development environment called Visual Basic Express. (You can read all about it in my complete tutorial - click here.) The bad news is that we're not going to base this tutorial on Microsoft's free system. We're going to assume that you're using Visual Basic version 6.0. More bad news is that it's becoming very difficult to actually buy a new copy of VB 6. Microsoft is doing a pretty good job of exterminating it in the retail market because you simply can't buy it from them anymore. The only copies that are available are left over from years ago. In fact, Microsoft stopped supporting it as a 'Mainstream' product in 2005.
The reason we're using VB 6.0 is first, to provide a really great VB environment. (Although Microsoft doesn't support it anymore, we do here and it is pretty great.) And second, to provide a tutorial that will match the software that a lot of people still actually use, in spite of Microsoft's position on it.
For the rest of you, make sure you have VB 6 installed and then start it up! You should see a development environment that looks something like this:
Notice that in the previous flowchart, the arrows pointed both ways from the computer to the 'operating system' and 'software libraries'. That is because you can actually make your own software modifications using VB. That's what some of the other icons are for. But for now, click the default "Standard EXE" icon and then click the "Open" button.
You should now see something that looks like this:
There are a lot of display options at this point and you might see other parts of Visual Basic on your computer such as the 'Project Explorer' window ...
... the 'Toolbox' ...
... or several other things. This leads to the next point. Your VB development environment has a lot of different components and you don't have to know what they all are right away. We're going to keep things as simple as possible and avoid discussing anything that you don't absolutely need. As you gain skill in VB, you'll figure out the new stuff.
No comments:
Post a Comment