Name

Implementation Keyword

Syntax

unit Name;
interface Declarations...
implementation Declarations...
end.

Description

The implementation section of a unit is required, although it can be empty. The implementation section contains the definitions of all functions, procedures, and methods that are declared in the unit’s interface section. You can also have additional type, subroutine, and variable declarations in the implementation section, in which case the declarations are private to the unit.

Changes to a unit’s implementation section do not force dependent units to be recompiled.

Tips and Tricks

Any used units not needed for the interface section should be listed in the uses declaration of the implementation section. This minimizes the amount of recompilation, should one of those units change. Changes to the interface—including changes to used units—force a recompilation of all dependent units. Changes to the implementation section, on the other hand, do not propagate to dependent units.

Example

See the unit keyword for an example.

See Also

Interface Keyword, Unit Keyword, Uses Keyword

Get Delphi in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.