RAD Studio
ContentsIndex
PreviousUpNext
Editing Package Source Files Manually

Package source files, like project files, are generated by Delphi from information you supply. Like project files, they can also be edited manually. A package source file should be saved with the .dpk (Delphi package) extension to avoid confusion with other files containing Del source code.

To open a package source file in the Code editor

  1. Open the package in RAD Studio.
  2. Right-click the package in the Project Manager and choose View Source.
    • The package heading specifies the name for the package.
    • The requires clause lists other, external packages used by the current package. If a package does not contain any units that use units in another package, then it doesn't need a requires clause.
    • The contains clause identifies the unit files to be compiled and bound into the package. All units used by contained units which do not exist in required packages will also be bound into the package, although they won't be listed in the contains clause (the compiler will give a warning). For example, the following VCL code declares the vcldb package (in the source file vcldb90.bpl):

package MyPack;
{$R *.res}
    ...{compiler directives omitted}
requires
    rtl,
    vcl;
contains
    Db,
    NewComponent1 in 'NewComponent1.pas';
end.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!