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.