1

What is the conditional compiler directive binded to Delphi XE4 compiler? I though something like this:

{$ifdef VerDXE4}
  code segment compiled only by the Delphi XE4 compiler
{$endif}
Kromster
  • 7,181
  • 7
  • 63
  • 111
The Bitman
  • 1,279
  • 1
  • 11
  • 25

2 Answers2

5
{$IFDEF VER250} // RAD Studio XE4
{$ENDIF}

The various versions are documented on Embarcadero's DocWiki:

Delphi Compiler Versions

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Dave Olson
  • 1,435
  • 1
  • 9
  • 16
2

You can use VER250:

{$IFDEF VER250}
...
{$ENDIF}

Alternatively, you can use the CompilerVersion constant:

{$IF (CompilerVersion >= 25) and (CompilerVersion < 26)}
...
{$IFEND}
Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770