Chapter 7 View contents of this chapter

Introduction

In this chapter, instead of concentrating on graphical objects such as labels and command buttons, we will concentrate on the different types of variables and constants. You will see how to declare them and use them.

A Few Preliminaries

When you're working with code, you need to know a few preliminary details. Your projects to this point have included only one form, and that form holds the controls and the event procedures related to controls. A form can hold code that is not specifically event procedure code but is more general purpose also. Code can also appear inside a separate module. The project window lists the module if one appears in the project.

Play Sound A module is a file that holds procedure code. The file that holds the form and its code is technically called the Form module.

If an application contains several forms, the first form you create is the default startup form.

Play Sound The default startup form is the first form to appear on the screen when a user starts the application.

You can designate another startup form by selecting Project<project name> Properties from the VB menu, where <project name> is the name of the current project.

Inside the Code Window

A Form Module holds not only event procedures but also a declarations section. The declarations section reserves space for and names data areas used throughout the rest of the module. The declarations section always appears at the top of every module that contains code. In the declarations section you often declare data storage areas. The code that is typed before a module's first event procedure is considered to be general purpose. Notice that the Code window's Object and procedure drop-down list boxes read (General) and (Declarations). The code window lets you know where each line of code falls in the program's scheme through these drop-down list boxes.




© Universal Teacher Publications        INDEX Previous Screen Next Screen