P1: IML
Owen WL040/Bidgolio-Vol I WL040-Sample.cls June 20, 2003 17:37 Char Count= 0
VISUALBASIC—THELANGUAGE 609advanced database management and offer tools to pack-
age and distribute applications. (Bradley & Millspaugh,
1998).Visual Basic as a Structured Language
Visual Basic is a structured programming language.
Structured programming, which grew into its own dur-
ing the 1970s, is a disciplined approach to programming
that strives to make programs easier to understand, de-
velop, test, and maintain. Logic in a structured program
can be expressed only through the use of restrictive con-
trol structures, each of which has a single entry point and
a single exit point. These control structures include the
following:Sequential structure,
Conditional (or selection) structure,
Repetitive (or iterative) structure,
Subroutine and function calls, and
Error trapping.Visual Basic implements these control structures with
a variety of statements. The conditional, or selection,
structure is implemented with If, If...Else, and Select
Case statements. Visual Basic also supports five repetitive
structures, the pretest While, the pretest Until, the posttest
While, the posttest Until, and the counter-controlled
(For...Next) loop structure.
Structured programming also encourages the use of
modularization, dividing large programming tasks into
smaller, more manageable segments. These segments,
called modules or subroutines, are supported in Visual
Basic by procedure calls and function calls. The use of
modules also promotes the concept of reusable code, sec-
tions of a program that can be accessed several times and
from several locations within a program (Harriger, Lisack,
Gotwals, & Lutes, 1999).
Error trapping in Visual Basic is accomplished through
the Err object. This object, which exists in all Visual Basic
programs, contains properties that are updated with spe-
cific information about all errors that occur. Specific sec-
tions of a module can be designated as error handlers by
the On Error GoTo statement. When an error occurs, pro-
gram control is transferred to the segment of the module
specified in the GoTo portion of the On Error statement.
A module may handle some errors internally and pass
others to the operating system for disposition (Harriger
et al., 1999).Visual Basic as an Application
Development Tool
Rapid Application Development
The goal of RAD (rapid application development) is to
speed and streamline the design, coding, testing, and de-
ployment of applications. Visual Basic is well suited to
this task. Visual Basic provides the programmer with a
comprehensive list of controls that are commonly found
in Windows applications. These controls can be quickly
placed in a Windows application with a simple drag-and-
drop action. The controls immediately exhibit the look,feel, and operating characteristics of similar Windows
controls. The repetitive and tedious task of recreating
each control has been eliminated, allowing the program-
mer to quickly build the interface and move on to the
task of making the various controls react appropriately to
user manipulation. Since a control’s behavior is consistent
across modules and between applications, maintenance
and team application development are easier (Shelly et al.,
1999).Rapid Interface Design and Prototyping
The rich control set provided by Visual Basic is an as-
set in the prototyping and design phases of program de-
velopment. The ability to quickly design and build a par-
tially functional user interface allows the programmer to
give quick feedback to end users about the information
used, the information created, and the way users interact
with the program. From this, users can determine if the
application meets their needs before valuable resources
are spent on the complete design and development pro-
cess. Consistent control behavior across applications al-
lows users to be productive with little or no training. Users
can interact with the program while it is still in the early
design stages and provide suggestions for modifications
while they are relatively easy to implement. With minimal
programming, controls can respond to user inputs. Users
get a better idea of what the program does and how it
“feels.” Users can identify problems with the data and the
interface early in the development process, while changes
are relatively easy to make. Early user involvement in the
testing process prevents the investment of development
resources in a system based on incorrect processing, in-
correct data, or ineffective interfaces. The more efficient
use of resources also reduces development time.Wizards
Visual Basic provides several wizards to speed many of
the common tasks related to application development and
deployment. Visual Basic includes wizards to build app-
lication frameworks, create data forms to display infor-
mation from a database, and create setup disks to deploy
Visual Basic programs (Harrington, Spenik, Brumbaugh,
& Diamond, 1997). Wizards automate a task by using a
series of dialog boxes to gather information and walk the
user through the process (Harriger et al., 1999).Object-Oriented Programming
and Visual Basic
Visual Basic is frequently called an object-oriented pro-
gramming (OOP) language. A basic understanding of ob-
jects is needed to fully understand how Visual Basic fits
into the OOP framework (Bradley & Millspaugh, 1998).
An object can represent anything, from an automobile to a
microware oven to a mathematical equation. All informa-
tion about the object, including its uses and behaviors, is
part of the object. An object is, in a programming environ-
ment, a set of data and any programming needed to ma-
nipulate those data. Combining data and programming
into a single unit is called encapsulation. The program-
ming elements used to manipulate the data in the object
are called methods. Encapsulation packs the object’s data