Delphi Language Guide Delphi for Microsoft Win32 Delphi for the Microsoft. Net framework



Yüklə 0,84 Mb.
Pdf görüntüsü
səhifə20/294
tarix02.01.2022
ölçüsü0,84 Mb.
#41395
1   ...   16   17   18   19   20   21   22   23   ...   294
DelphiLanguageGuide

The Program Heading
The program heading specifies a name for the executable program. It consists of the reserved word program,
followed by a valid identifier, followed by a semicolon. The identifier must match the project source file name.
The following example shows the project source file for a program called Editor. Since the program is called Editor,
this project file is called Editor.dpr.
program Editor;
  uses Forms, REAbout, // An "About" box
       REMain;         // Main form
  {$R *.res}
  begin
   Application.Title := 'Text Editor';
13


   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.

Yüklə 0,84 Mb.

Dostları ilə paylaş:
1   ...   16   17   18   19   20   21   22   23   ...   294




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©www.azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin