Delphi Define Directive



  1. Define Directive Control
  2. What Is A Directive

Author links: Buy Website Traffic at Buy Proxies at: Delphi Programming © Neil Moffatt All rights reserved. Home Page Home Page.

Delphi Define Directive

VER80 - Delphi 1. VER90 - Delphi 2. VER100 - Delphi 3. VER120 - Delphi 4. VER130 - Delphi 5. VER140 - Delphi 6.

VER150 - Delphi 7. VER160 - Delphi 8. VER170 - Delphi 2005.

VER180 - Delphi 2006. VER180 - Delphi 2007. VER185 - Delphi 2007. VER200 - Delphi 2009.


VER210 - Delphi 2010. VER220 - Delphi XE. VER230 - Delphi XE2. WIN32 - Indicates that the operating environment is the Win32 API.

LINUX - Indicates that the operating environment is Linux. MSWINDOWS - Indicates that the operating environment is the MS Windows/li. CONSOLE - Indicates that an application is being compiled as a console application.

Each Delphi compiler directive is classified as either a switch, parameter, or conditional compilation directive. A compiler directive is a comment with a special syntax. Compiler directives can be placed wherever comments are allowed. A compiler directive starts with a $ as the first character after the opening comment delimiter, immediately followed by a name (one or more letters) that designates the particular directive.


You can include comments after the directive and any necessary parameters. Three types of directives are described in the following topics:. Switch directives turn particular compiler features on or off.

Define Directive Control

For the single-letter versions, you add. Conditional compilation is based on the existence and evaluation of constants, the status of compiler switches, and the definition of conditional symbols. Conditional symbols work like Boolean variables: They are either defined (true) or undefined (false). Any valid conditional symbol is treated as false until it has been defined. The $DEFINE directive sets a specified symbol to true, and the $UNDEF directive sets it to false.

What Is A Directive

You can also define a conditional symbol by using the -D switch with the command-line compiler or by adding the symbol to the Conditional Defines box on the Directories/Conditionals page of the Project Options dialog.

This entry was posted on 07.09.2019.