Name

$Include Compiler Directive

Syntax

{$Include FileName}
{$I FileName}

Scope

Local

Description

The $Include compiler directive tells the compiler to read FileName and include its entire contents where the $Include directive appears.

The best way to use $Include is to import conditional definitions and compiler directives. You should use units to import type, variable, and subroutine declarations.

Use quotes around FileName to protect spaces and other special characters.

See Also

Unit 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.