Application.CreateForm(TMainForm, MainForm);
Application.Run;
end.
The first line contains the program heading. The uses clause in this example specifies a dependency on three
additional units:
Forms
,
REAbout
, and
REMain
. The
$R
compiler directive links the project's resource file into the
program. Finally, the block of statements between the begin and end keywords are executed when the program
runs. The project file, like all Delphi source files, ends with a period (not a semicolon).
Delphi project files are usually short, since most of a program's logic resides in its unit files. A Delphi project file
typically contains only enough code to launch the application's main window, and start the event processing loop.
Project files are generated and maintained automatically by the IDE, and it is seldom necessary to edit them
manually.
In standard Pascal, a program heading can include parameters after the program name:
program Calc(input, output);
Borland's Delphi ignores these parameters.
In Delphi 2005, a the program heading introduces its own namespace, which is called the project default namespace.
This is also true for the library and package headers, when these types of projects are compiled for the .NET platform.
Dostları ilə paylaş: