A Delphi project is composed of several related files. Some files are created at design time, and others are generated when the project is compiled. To manage Delphi projects effectively (Delphi project), you must know the purpose of each file.
Let me first familiarize myself with the project file, which was created at design time, with the extension of . DPR. This file is also the main file of the program.
The individual files of the Delphi project must follow a predefined format so that the compiler can read the unit and compile it into unit code.
Let me see how to view the project file DPR for the default Delphi project:
Step1, open Delphi7, selectFile | New | Application", create a default Delphi application;
Step2, selectProject | Viewsource, you can see a default Delphi Project source code (. DPR);
Step3, a default Delphi project source code is as follows:
| 12345678910111213 |
programProject1; {关键字program,标准的Pascal源文件格式}uses{uses单元引用列表} Forms, {Forms窗体单元} Unit1 in‘Unit1.pas‘{Form1};{$R *.res} {编译器指令,引用项目的资源文件} begin{begin..end之间是具体的代码} Application.Initialize; {初始化Appliaciton} Application.CreateForm(TForm1, Form1); {创建Application的主窗体} Application.Run; {启动Application}end. {关键字end.表示代码结束} |
To this end, a simple Delphi project file is so concise, generally we do not need to edit the project file, unless you want to execute the program initialization routines, display the splash screen or perform other routines that must be run at program startup.
Delphi Project composition Project Document DPR