Programs and units
A program is constructed from source-code modules called units. Each unit is stored in its own file and compiled separately; compiled units are linked to create an application. Units allow you to
·divide large programs into modules that can be edited separately.
·create libraries that you can share among programs.
·distribute libraries to other developers without making the source code available.
In traditional Pascal programming, all source code, including the main program, is stored in .pas files. Borland tools use a project (.dpr) file to store the main program, while most other source code resides in unit (.pas) files. Each application or project consists of a single project file and one or more unit files. (Strictly speaking, you needn’t explicitly use any units in a project, but all programs automatically use the System unit.) To build a project, the compiler needs either a source file or a compiled unit file for each unit.
