Modules
What modules are
A Basic4ppc module is the fundamental building block of a project. A module is a code file, holding code, controls, objects and forms. All Basic4ppc programs contain a main module called "Main", held in a file with the name of the project and the extension ".sbp". Additional modules are held in files named by the programmer - the file has the same name as the module does, with the extension ".bas". A Basic4ppc project is composed of the main module and any number of additional modules. The program execution starts at the main module, but other subs and variables can be stored in any other module. Modules are displayed in the Project tree as follows:

A project divided
into two modules - the main module's name is Main (though the file name is
different)
and the second module's name is Module2, with the file name "Module2.bas".
What are modules for
Main advantages of modules are:
Reuse: a module written for one project can be used in a second project.
Generalization: modules can be written as general libraries of procedure with specific subject, used by many programs and distributed unrelated to any project.
Encapsulation: a module writer controls which part of the module is exposed to the outer world, thus allow the user to add certain functionality to a project without being bothered by the implementation. Modules can share parts of the code and hide other parts. This is usually achieved by the use of access modifiers, indicating which part of the module is accessible from where.
Convenience: modules allow splitting large projects into small pieces which are easier to deal with, making them more understandable and easy to manage.
Next page: Manipulating modules