IFOPT directive (Delphi)

From RAD Studio
Jump to: navigation, search

Go Up to Delphi Compiler Directives (List) Index

Type

Conditional compilation

Syntax

{$IFOPT switch}


The $IfOpt compiler directive is a meta-directive, which means that it tests for the positive (+) or negative (-) state of a single character compiler directive.

For example:

{$IFOPT R+}
   Writeln('Compiled with range-checking');
 {$ENDIF}

The Writeln statement compiles if the $R option is currently active.

Note:
$IfOpt can be used multiple times in your code.

Long directives support

The following section lists all the supported long directives that have no short directive counterpart.

Long Directive Options

{$IFOPT ALLOWBIND}

ON or OFF

{$IFOPT ALLOWISOLATION}

ON or OFF

{$IFOPT CODEALIGN}

0, 1, 2, 4, 8, 16

{$IFOPT COMPATIBLELITERALS}

ON or OFF

{$IFOPT DENYPACKAGEUNIT}

ON or OFF

{$IFOPT DESIGNONLY}

ON or OFF

{$IFOPT DUPLICATEENABLE}

ON or OFF

{$IFOPT DYNAMICBASE}

ON or OFF

{$IFOPT EXCESSPRECISION}

ON or OFF

{$IFOPT EXTENDEDCOMPATIBILITY}

ON or OFF

{$IFOPT HIGHCHARUNICODE}

ON or OFF

{$IFOPT HIGHENTROPYVA}

ON or OFF

{$IFOPT HINTS}

ON or OFF

{$IFOPT IMPLICITBUILD}

ON or OFF

{$IFOPT INLINE}

ON, OFF, or AUTO

{$IFOPT LARGEADDRESSAWARE}

ON or OFF

{$IFOPT LEGACYIFEND}

ON or OFF

{$IFOPT NATIVE_CPP_INTERFACES}

ON or OFF

{$IFOPT NXCOMPAT}

ON or OFF

{$IFOPT OBJEXPORTALL}

ON or OFF

{$IFOPT OLDTYPELAYOUT}

ON or OFF

{$IFOPT POINTERMATH}

ON or OFF

{$IFOPT REALCOMPATIBILITY}

ON or OFF

{$IFOPT RUNONLY}

ON or OFF

{$IFOPT SCOPEDENUMS}

ON or OFF

{$IFOPT SETOSVERSION<op><Version>}

<op>: one of the following symbols: =, <>, < >, <=, >=
<Version>: version number
Example:

{$IFOPT SETOSVERSION>=6.0}

{$IFOPT SETPEFLAGS<IntConst>}

IntConst

{$IFOPT SETPEOPTFLAGS<IntConst>}

IntConst

{$IFOPT SETSUBVERSION<op><Version>}

<op>: one of the following symbols: =, <>, < >, <=, >=
<Version>: version number
Example:

{$IFOPT SETSUBVERSION>=9.2}

{$IFOPT SETUSERVERSION<op><Version>}

<op>: one of the following symbols: =, <>, < >, <=, >=
<Version>: version number
Example:

{$IFOPT SETUSERVERSION<=5.}

{$IFOPT STRONGLINKTYPES}

ON or OFF

{$IFOPT TEXTBLOCK}

NATIVE, CR, LF, CRLF

{{code|{$IFOPT TSAWARE

ON or OFF

{$IFOPT TYPEINF}

OFF

{$IFOPT VARPROPSETTER}

ON or OFF

{$IFOPT VARSTRINGCHECKS}

ON or OFF

{$IFOPT WARN <Ident>}

ON, OFF, or ERROR

{$IFOPT WARNINGS}

ON, OFF, or ERROR

{$IFOPT WEAKLINKRTTI}

ON or OFF

{$IFOPT WEAKPACKAGEUNIT}

ON or OFF

{$IFOPT WRITEABLECONST}

ON or OFF

{$IFOPT ZEROBASEDSTRINGS}

ON or OFF