Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Introduction to the Visual Basic Programming Language

Introduction to the Visual Basic Programming Language



|Views: 502 |Likes:
Published by api-3749038

More info:

Published by: api-3749038 on Oct 15, 2008
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less





Introduction to the Visual Basic Programming Language

Microsoft Visual Basic 2005 Express Edition is a fast and easy way to create programs for Microsoft Windows. Even if you are new to Windows programming, with Visual Basic you have a complete set of tools to simplify development.

So what is Visual Basic? "Visual" refers to the method used to create what the user sees\u2014thegraphica l
user interface, or GUI. "Basic" refers to the BASIC (Beginners All-Purpose Symbolic Instruction Code)

programming language, a language used by more programmers than any other language in the history of computing. You can create useful programs by learning just a few of its features. The following links will get you started with Visual Basic programming; each link includes examples, as well as access to additional information.

Programming Concepts
What exactly is a programming language? The following links will give you some background on what a
language is and how it stores different types of information.
The Basics: How Programming Works
How a programming language works, along with
basic terminology.
Representing Words, Numbers, and Values
with Variables
How variables store values and represent
information, along with how to use variables.
Words and Text: Using String Variables to
Organize Words
How to use aString variable to represent words and
Arrays: Variables That Represent More
Than One Value
How to use anArray variable to represent several
values of the same type.
Arithmetic: Creating Expressions With
Variables And Operators
How to write code that performs arithmetic.
Comparisons: Using Expressions to
Compare Values
How to write code that compares numeric values.
Your First Program
Ready for a bit of real-world programming? The following links will walk you through the creation of a
simple program and will show you how to check your program for errors.
Making Your Computer Do Something:
Writing Your First Procedure
How to write code that tells your program to perform
a particular action.
Making Your Program Repeat Actions:
Looping With the For...Next Loop

How to write code that repeats actions in your
program and counts how many times these actions
have been performed.

Making Your Program Choose Between
Two Possibilities: The If...Then Statement
How to write code that does different things in
response to different conditions.
What To Do When Something Goes
How to write code that handles errors in your
Wrong: Handling Errors
programs. You will also learn about the different
types of errors.
More About Visual Basic
The following links will help you build on your knowledge of programming and of the Visual Basic 2005.
Closer Look: Understanding Properties,
Methods, and Events
How properties, methods, and events work.
Closer Look: Data Types
How data is stored using the different types of
Closer Look: Converting from One Variable
Type to Another
How to convert data from one type to another,
along with some common pitfalls of this process.
Closer Look: Using Do...While and
Do...Until to Repeat Until a Condition is Met

How to use theDo...Whil e andDo...Until statements to repeat code based on certain conditions.

Closer Look: Using Select Case to Decide
Between Multiple Choices
How to run code based on multiple conditions,
where there are many choices.
Visual Basic Guided Tour
More of what you can do with the Visual Basic
2005 programming language
The Basics: How Programming Works

Before you jump in and start learning the Visual Basic programming language, it may help you to understand what a programming language is and how it works, including some programming terminology. The best place to start is with the basics.

How Programming Works
On its own, a computer isn't very smart.

A computer is essentially just a big bunch of tiny electronic switches that are either on or off. By setting different combinations of these switches, you can make the computer do something, for example, display something on the screen or make a sound. That's what programming is at its most basic\u2014telling a computer what to do.

Of course, understanding which combination of switches will make the computer do what you want
would be a daunting task\u2014that's where programming languages come in.
What is A Programming Language?

People express themselves using a language with many words. Computers use a simple language consisting of only 1s and 0s, with a 1 meaning "on" and a 0 meaning "off." Trying to talk to a computer in its own language would be like trying to talk to your friends using Morse code\u2014it can be done, but why would you?

A programming language acts as a translator between you and the computer. Rather than learning the computer's native language (known as machine language), you can use a programming language to instruct the computer in a way that is easier to learn and understand.


A specialized program known as acompi ler takes the instructions written in the programming language and converts them to machine language. This means that as a Visual Basic programmer, you don't need to understand what the computer is doing or how it does it, you just need to understand how the Visual Basic programming language works.

Inside the Visual Basic Language

In many ways, Visual Basic is a lot like the language that you use every day. When you speak or write, you use different types of words, such as nouns or verbs, which define how they are used. Visual Basic also has different types of words known as programming elements that define how they are used to write programs.

Programming elements in Visual Basic includestatements,declarations,methods,operators, and
keywords. As you complete the following lessons, you will learn more about these elements and how to
use them.

Written and spoken language also has rules, orsyntax, that defines the order of words in a sentence. Visual Basic also has syntax\u2014at first it may look strange, but it is actually very simple. For example, to state "The maximum speed of my car is 55", you would write:

Car.Speed .Max imum = 55
You will learn more about syntax later, and tools in Visual Basic such asIntelli Sense provide you with
guidance in using the correct syntax when writing programs.

The language you write and speak also has structure: for example, a book has chapters with paragraphs that contain sentences. Programs written in Visual Basic also have a structure:modules are like chapters,procedures are like paragraphs, and lines of code are like sentences.

Next Steps

In this lesson, you learned what a programming language is and how it works. In the next lesson, you will start learning how to use the Visual Basic programming language. Don't worry\u2014you'll be speaking Visual Basic in no time at all!

Representing Words, Numbers, and Values with Variables
Variables are an important concept in computer programming. A variable is a letter or name that can

store a value. When you create computer programs, you can use variables to store numbers, such as the height of a building, or words, such as a person's name. Simply put, you can use variables to represent any kind of information your program needs.

You might ask, "Why use a variable when I could just use the information instead?" As the name implies, variables can change the value that they represent as the program is running. For example, you might write a program to track the number of jelly beans you have in a jar on your desk. Because candy is meant to be eaten, the number of jelly beans in the jar is likely to change over time. Rather than rewriting your program every time you get a sugar craving, you can represent the number of jelly beans with a variable that can change over time.

Storing Information in Variables
There are three steps to using a variable:
1.Declare the variable. Tell the program the name and kind of variable you want to use.
2.Assign the variable. Give the variable a value to hold.

Activity (25)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Monty Sharma liked this
Karthi Kaiean liked this
EdEmmet liked this
chathuddk liked this
hypersoftclient liked this
peterangka liked this
Sornam Madasamy liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->