What is a project?

 

A project is a collection of files that make up an application or dynamic-link library. Some of these files are created at design time. Others are generated when you compile the project source code.

You can combine projects into a project group. Project groups let you organize and work on related projects, such as applications and DLLs that function together or parts of a multi-tiered application.

You can view the files that make up a project in the Project Manager (see Viewing a project’s contents). Although you can edit many of these files directly, it is often easier and more reliable to use the visual tools in this product. You should, however, understand the files and file types that make up a project.

Single project files, which describe individual projects, have a .dpr extension. Project files contain directions for building an application or library. When you add and remove files using the Project Manager, the product updates the project file.

The product reads the uses clause of the project (.dpr) file to determine which units are part of a project. Only units that appear in the uses clause followed by the keyword in and a file name are considered part of the current project. For example, here is the default project file for new applications:

 

program Project1;

 

uses

  Forms,

  Unit1 in 'Unit1.pas' {Form1};

 

{$R *.res}

 

begin

  Application.Initialize;

  Application.CreateForm(TForm1, Form1);

  Application.Run;

end.

 

The project defined above uses two units: Forms and Unit1. Only Unit1, however, is actually part of the project.

The project group file contains make commands to build the projects in the project group, has a .bpg extension. Any time you add a project to the project group, a reference to that project is added to the .bpg file.

You can also add additional types of files to your project (using drag and drop or Project|Add to Project) and view them in the editor as text files. You can also add resource files, and they are compiled into .res files and linked when you compile the project.