Difference between revisions of "$IF"

From Lazarus wiki
Jump to navigationJump to search
(syntaxhighlight, other example)
m (better syntax highlighting)
Line 1: Line 1:
 
{{$IF}}
 
{{$IF}}
  
The <code>$IF</code> directive can be used in [[Conditional compilation|conditional compilation]].
+
The <syntaxhighlight lang="pascal" enclose="none">{$if …}</syntaxhighlight> directive can be used in [[Conditional compilation|conditional compilation]].
  
<syntaxhighlight>
+
<syntaxhighlight lang="pascal" highlight="2,5">
 
// pointermath directive did not exist prior FPC 3.0.0
 
// pointermath directive did not exist prior FPC 3.0.0
 
{$if FPC_VERSION > 2}
 
{$if FPC_VERSION > 2}

Revision as of 18:35, 11 February 2018

Deutsch (de) English (en) français (fr) русский (ru)

The {$if …} directive can be used in conditional compilation.

// pointermath directive did not exist prior FPC 3.0.0
{$if FPC_VERSION > 2}
	// pointer arithmetics is bad. very bad
	{$pointermath off}
{$endif}
Directives, definitions and conditionals definitions
global compiler directives • local compiler directives

Conditional Compiler Options • Conditional compilation • Macros and Conditionals • Platform defines
$IF