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


Package Declarations and Source Files



Yüklə 0,84 Mb.
Pdf görüntüsü
səhifə215/294
tarix02.01.2022
ölçüsü0,84 Mb.
#41395
1   ...   211   212   213   214   215   216   217   218   ...   294
DelphiLanguageGuide

Package Declarations and Source Files
Each package is declared in a separate source file, which should be saved with the .dpk extension to avoid confusion
with other files containing Delphi code. A package source file does not contain type, data, procedure, or function
declarations. Instead, it contains:
a name for the package.
a list of other packages required by the new package. These are packages to which the new package is linked.
a list of unit files contained by, or bound into, the package when it is compiled. The package is essentially a
wrapper for these source-code units, which provide the functionality of the compiled package.
A package declaration has the form
packagepackageName;
requiresClause;
186


containsClause;
end.
where packageName is any valid identifier. The requiresClause and containsClause are both optional. For example,
the following code declares the 
DATAX
 package.
package DATAX;
  requires
  rtl,
  contains Db, DBLocal, DBXpress, ... ;
end.
The requires clause lists other, external packages used by the package being declared. It consists of the directive
requires, followed by a comma-delimited list of package names, followed by a semicolon. If a package does not
reference other packages, it does not need a requires clause.
The contains clause identifies the unit files to be compiled and bound into the package. It consists of the directive
contains, followed by a comma-delimited list of unit names, followed by a semicolon. Any unit name may be followed
by the reserved word in and the name of a source file, with or without a directory path, in single quotation marks;
directory paths can be absolute or relative. For example,
contains MyUnit in 'C:\MyProject\MyUnit.pas';

Yüklə 0,84 Mb.

Dostları ilə paylaş:
1   ...   211   212   213   214   215   216   217   218   ...   294




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

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin