1.2.11 $DEFINE or $DEFINEC : Define a symbol

The directive

{$DEFINE name}

defines the symbol name. This symbol remains defined until the end of the current module (i.e. unit or program), or until a $UNDEF name directive is encountered.

If name is already defined, this has no effect. Name is case insensitive.

The symbols that are defined in a unit, are not saved in the unit file, so they are also not exported from a unit.

Under Mac Pascal mode, the $DEFINEC directive is equivalent to the $DEFINE directive and is provided for Mac Pascal compatibility.

{$DEFINE} can also be used to define macros or compile-time constants:

{$DEFINE cdecl:=stdcall}

will redefine the standard modifier cdecl as stdcall.

More information about macros and compile-time constants, can be found in section 2.2, page 296

The {$DEFINE} directive has a command-line equivalent, -d

-dNAME

will define the symbol Name. Using

-dcdecl:=stdcall

one can redefine the standard modifier cdecl as stdcall from the command-line.