Almost all program users and game players alike want to create their own software, whether it being a massive game, an easy-to-use calendar, or maybe even a hack. However, they must master, or at least know much about a programming language. If you've ever seen a Source Code , a text code written by a programmer and execute tasks by a computer, you'll know how much time and effort it takes to learn these nevertheless create them. This tutorial will demonstrate the basics of programming, which I feel VB is. VB, or Visual Basics, is a simple programming language created for inexperienced programmers to enter the world of programming. Once you've mastered Visual Basics, you can easily advance to harder languages like JavaScript and C++.
Before I get to the main subject, I'm going to mention a couple of important requirements. I recommend this language to you as long as you follow these:
- You have an understanding of the language HTML. You should know a little bit of these before proceeding.
- You have the patience to spend numerous hours devoting your time and effort into testing and maintaining scripts.
- You know basic algebra.
- You can study terms and uses for a long time and attach them into your mind for long periods of time.
- You have nothing better to do. If you have a good life, don't spend your time with us nerds.
Now let us begin. Please note that I'm trying the best I can to simplify it in words and phrases you'll understand. If you don't understand something, don't panic. Most likely I will repeat it more clearly later on.
First off, you should get a nice program that runs and debugs Visual Basic script. I recommend Visual Basic 2005 Express Edition, which can be downloaded for free. Search for it to find it, since I don't want to post website links.
Now lets get to the good stuff--the programming. First off, every element has events. For example, the Enter your Post message form. When you enter your post and hit "Post New Topic/Post", the computer looks for code for that command. Cool, eh?
CODE
Dim CoolString as String
So, what does the above do? Well, "Dim" means to define. "CoolString" is the name of a variable. It can be anything you want. And "as String" means that the variable "CoolString" is a String. A string is simply a text. "CoolString" is a text that hasn't been defined yet. The Compiler, a program that runs scripts under certain programming languages, stores that variable inside its memory. You need to define what the variable is, which can be done later one.
CODE
Dim CoolInteger as Integer
The above code is similar to the first, except "CoolInteger" is defined as an Integer, which is a number. You can define what number "CoolInteger" is at anytime.
So, what’s the point of these? Well, suppose you wanted to add two values that can be changed. For example, the user types in "Hello" in one form, and "World" in the other. When he hits "OK", he wants the text to combine and say "Hello World". So, this is what he would do.
CODE
Dim box1 As String
Dim box2 As String
box1 = TextBox1.Text
box2 = TextBox2.Text
MessageBox.Show(box1 + " " + box2)
Dim box2 As String
box1 = TextBox1.Text
box2 = TextBox2.Text
MessageBox.Show(box1 + " " + box2)
Can you guess why this works? If not, I'll walk you through it.
First off, you call the variables "box1" and "box2" as string, which means they are both text. Then you tell "box1" that it's connected with "textbox1", which is the name of the first textbox. "box2" is connected with "textbox2", the second textbox. The "MessageBox.Show() command displays a message. The message is box1 (whatever the user typed in for textbox1, since they're connected) plus " ", which is just a space, plus box2 (whatever the user typed in for textbox2, since they're connected.) Easy, no? Well, the beginning stages are very confusing, so stay with me.
Now lets try Integers. We'll try making two forms that add numbers and display the results. Try it for yourself, and then compare it to mine.
CODE
Dim box1 As Integer
Dim box2 As Integer
box1 = TextBox1.Text
box2 = TextBox2.Text
MessageBox.Show(box1 + box2)
Dim box2 As Integer
box1 = TextBox1.Text
box2 = TextBox2.Text
MessageBox.Show(box1 + box2)
As you can see, it's identical to the previous one, except the strings are now integers and I removed the space between the adding of box1 and box2.
So, now that you have this knowledge fresh in your mind, test around and try out the various types of coding. You can try the various Dim features and others you might find as well. I'm keeping the first tutorial nice and short to avoid losing my viewers attention. Once your done, check out my soon-to-come part 2 tutorial, which will discuss more features. Remember that the very beginning of your learning is hard; soon enough, though, it'll become easy.

