Introduction
In this chapter, we will show you how to understand
complex Visual Basic Applications that contain multiple
modules and procedures that require sharing data between
each other. When writing complex applications, you
must be able to share data between procedures and
modules by declaring the variables appropriately and
by writing procedures in such a way that other procedures
can access them.
Moreover, you will use VB's internal functions to
perform common analysis and data manipulation of strings,
numbers, and other kinds of data.
Mastering Program Structure
By now you must have a good idea of how VB programs
operate. When the user interacts with controls, events
take place. The VB program code is a set of event
procedures with a Declarations section at the beginning
of the code.
|
Event procedures are not the only
procedures that can appear in code. |
A Form Module might contain declarations section,
event procedures, general procedures, and class procedures.
A general procedure is a procedure that is not linked
to a control event but performs general calculations.
A general procedure can be function or subroutine
procedures. For example, if you want to call a general
procedure named Calc(),
you can call it like this
Call calc()
|
The call statement transfers control
to a Sub procedure, Function procedure, or dynamic
link library (DLL) procedure. |
A class is a description of a set of characteristics.
In other words, a class defines a new data type or
variable. The class contains class procedures.
|