Introduction To VB 6
Introduction To VB 6
Programming means designing a set of instructions to instruct the computer to carry out certain jobs that
are very much faster than human beings can do. The earliest programming language is called machine language
which uses the binary code (comprises 0 and 1) to communicate with the computer. However, the machine
language is extremely difficult to learn. Fortunately, scientists have invented some high-level programming
languages that are much easier to master. Among the high-level programming languages are Java, Javascript, C,
C++, c# and Visual Basic.
Different types of programming language
Machine and assembly language
A machine language consists of the numeric codes for the operations that a particular computer can
execute directly. The codes are strings of 0s and 1s, or binary digits (“bits”), which are frequently converted both
from and to hexadecimal (base 16) for human viewing and modification. Machine language instructions typically
use some bits to represent operations, such as addition, and some to represent operands, or perhaps the location
of the next instruction. Machine language is difficult to read and write, since it does not resemble conventional
mathematical notation or human language, and its codes vary from computer to computer.
Assembly language is one level above machine language. It uses short mnemonic codes for instructions
and allows the programmer to introduce names for blocks of memory that hold data. One might thus write “add
pay, total” instead of “0110101100101000” for an instruction that adds two numbers. Assembly language is
designed to be easily translated into machine language.
Structured Programming
It is a programming approach in which the program is made as a single structure. It means that the code will
execute the instruction by instruction one after the other. It doesn’t support the possibility of jumping from one
instruction to some other with the help of any statement like GOTO, etc. Therefore, the instructions in this
approach will be executed in a serial and structured manner. The languages that support Structured programming
approach are:
C , C++, Java, C#
On the contrary, in the Assembly languages like Microprocessor 8085, etc, the statements do not get
executed in a structured manner. It allows jump statements like GOTO. So the program flow might be random.
The structured program mainly consists of three types of elements:
Selection Statements
Sequence Statements
Iteration Statements
In 2002, Microsoft released Visual Basic.NET(VB.NET) to replace Visual Basic 6. Thereafter, Microsoft
declared VB6 a legacy programming language in 2008. Fortunately, Microsoft still provides some form of support
for VB6. VB.NET is a fully object-oriented programming language implemented in the .NET Framework. It was
created to cater for the development of the web as well as mobile applications. However, many developers still
favor Visual Basic 6.0 over its successor Visual Basic.NET.
In VB 6, you can create any program depending on your objective. For math teachers, you can create
mathematical programs such as Geometric Progression, Quadratic Equation Solver, Simultaneous Equation
Solver ,Prime Number Tester, Factors Finder, Quadratic Function Graph Plotter and so on. For science teachers,
you can create simulation programs such as Projectile, Simple Harmonic Motion, Star War etc. If you are in
business, you can also create business applications such as inventory management system , Amortization
Calculator , investments calculator, point-of-sale system, payroll system, accounting program and more to help
manage your business and increase productivity. For those of you who like games , you can create programs such
as slot machine, reversi, tic tac toe and more. Besides, you can create multimedia programs such as Smart Audio
Player, Multimedia Player and more.
Visual Basic is event-driven, meaning code remains idle until called upon to respond to some event
(button pressing, menu selection, ...). Visual Basic is governed by an event processor. Nothing happens until an
event is detected. Once an event is detected, the code corresponding to that event (event procedure) is executed.
Program control is then returned to the event processor.
Standard EXE: A Standard EXE project is a typical application. Most of the application we are going to discuss
are Standard EXE project. These are type of applications we can developed with the previous version of Visual
basics.
Six windows appears when you start Visual Basic.
1. The Main Windows: The Main Window consists of the title bar, menu bar, and toolbar. The title bar
indicates the project name, the current Visual Basic operating mode, and the current form. The menu bar
has drop-down menus from which you control the operation of the Visual Basic environment. The toolbar
has buttons that provide shortcuts to some of the menu options. The main window also shows the location
of the current form relative to the upper left corner of the screen and the width and length of the current
form.
2. The Form Windows: The Form Window is central to developing Visual Basic applications. It is where
you draw your application.
3. The Toolbox: The Toolbox is the selection menu for controls used in your application.
4. The Properties Windows: The Properties Window is used to establish initial property values for objects.
The drop-down box at the top of the window lists all objects in the current form. Two views are available:
Alphabetic and Categorized. Under this box are the available properties for the currently selected object.
5. The Form Layout Windows: The Form Layout Window shows where (upon program execution) your
form will be displayed relative to your monitor’s screen:
6. The Project Windows: The Project Window displays a list of all forms and modules making up your
application. You can also obtain a view of the Form or Code windows (window containing the actual
Basic coding) from the Project window.