Delphi Programming
Tag: Source edit
(21 intermediate revisions by 9 users not shown)
Line 9: Line 9:
   
 
<div class="VclDescription">
 
<div class="VclDescription">
The CompilerVersion constant identifies the internal version number of the Delphi compiler. It is defined in the System unit and may be referenced either in code just as any other constant:
+
The CompilerVersion constant identifies the internal version number of the Delphi compiler. It is defined in the System unit and may be referenced either in code just as any other constant.
 
if CompilerVersion = 20 then
 
sCompilerName := 'Delphi 2009';
 
 
or in conditional compiler expressions:
 
 
{$if CompilerVersion &gt; 18}
 
// Delphi 2007 or later
 
{$ifend}
 
 
</div>
 
</div>
   
Line 24: Line 15:
   
 
<div class="VclTechnicalComments">
 
<div class="VclTechnicalComments">
The CompilerVersion constant was introduced in Delphi 6 along with [[conditional expressions]]. In earlier Delphi versions various compiler defined VERxxx symbols are used to determine compiler versions.
+
The CompilerVersion constant was introduced in Delphi 6 along with [[conditional expressions]]. In earlier Delphi versions various compiler defined [[Borland Compiler Conditional Defines|VERxxx]] symbols are used to determine compiler versions.
   
 
CompilerVersion values and the equivalent compiler defined symbols for the Delphi versions in which the CompilerVersion constant is defined are:
 
CompilerVersion values and the equivalent compiler defined symbols for the Delphi versions in which the CompilerVersion constant is defined are:
Line 31: Line 22:
 
! scope="col" | Compiler
 
! scope="col" | Compiler
 
! scope="col" | CompilerVersion
 
! scope="col" | CompilerVersion
! scope="col" |
+
! scope="col" |
 
Defined Symbol
 
Defined Symbol
  +
|-
  +
| Delphi 11.0 Alexandria || 35 || VER350
  +
|-
  +
| Delphi 10.4 Sydney || 34 || VER340
  +
|-
  +
| Delphi 10.3 Rio || 33 || VER330
  +
|-
  +
| Delphi 10.2 Tokyo || 32 || VER320
  +
|-
  +
| Delphi 10.1 Berlin || 31 || VER310
  +
|-
  +
| Delphi 10 Seattle || 30 || VER300
  +
|-
  +
| Delphi XE8 || 29 || VER290
  +
|-
  +
| Delphi XE7 || 28 || VER280
  +
|-
  +
| Delphi XE6 || 27 || VER270
  +
|-
  +
| AppMethod 1 || 26.5 || VER265
  +
|-
  +
| Delphi XE5 || 26 || VER260
  +
|-
  +
| Delphi XE4 || 25 || VER250
 
|-
 
|-
 
| Delphi XE3 || 24 || VER240
 
| Delphi XE3 || 24 || VER240
 
|-
 
|-
| Delphi XE2 || 23 ||
+
| Delphi XE2 || 23 || VER230
VER230
 
 
|-
 
|-
 
| Delphi XE || 22 || VER220
 
| Delphi XE || 22 || VER220
Line 47: Line 61:
 
| Delphi 2007 .NET || 19 || VER190
 
| Delphi 2007 .NET || 19 || VER190
 
|-
 
|-
| Delphi 2007 || 18.5 || VER185
+
| Delphi 2007 || 18.5 || VER185 (also VER180)
 
|-
 
|-
 
| Delphi 2006 || 18 || VER180
 
| Delphi 2006 || 18 || VER180
Line 59: Line 73:
 
| Delphi 6 || 14 || VER140
 
| Delphi 6 || 14 || VER140
 
|-
 
|-
| Delphi 5 || 13 || VER130
+
| Delphi 5 || 13(*) || VER130
 
|-
 
|-
| Delphi 4 || 12 || VER120
+
| Delphi 4 || 12(*) || VER120
 
|-
 
|-
| Delphi 3 || 10 || VER100
+
| Delphi 3 || 10(*) || VER100
 
|-
 
|-
| Delphi 2 || 9 || VER90
+
| Delphi 2 || 9(*) || VER90
 
|-
 
|-
| Delphi 1 || 8 || VER80
+
| Delphi 1 || 8(*) || VER80
 
|}
 
|}
 
</div>
 
</div>
  +
  +
(*) These versions did not have a CompilerVersion constant, it was introduced with Delphi 6.
   
 
==Examples==
 
==Examples==
   
 
<div class="VclExamples">
 
<div class="VclExamples">
  +
<pre>
(Please provide <i>links</i> to articles/source code that show how to use this item.)
 
 
if CompilerVersion = 20 then
 
sCompilerName := 'Delphi 2009';
  +
</pre>
 
or in conditional compiler expressions:
  +
<pre>
 
{$if CompilerVersion &gt; 18}
 
// Delphi 2007 or later
 
{$ifend}
  +
</pre>
 
</div>
 
</div>
   
Line 91: Line 116:
 
</div>
 
</div>
   
<!-- Please keep the category list at the bottom for consistency. --> Added D2010, Uffe Kousgaard<br />Added Delphi XE, Steven Kamradt<br />Added Delphi 2007.NET by Jaro.Benes />Added Delphi XE3 by Jaro.Benes
+
<!-- Please keep the category list at the bottom for consistency. --> Added D2010, Uffe Kousgaard<br />Added Delphi XE, Steven Kamradt<br />Added Delphi 2007.NET by Jaro.Benes<br />Added Delphi XE3 by Jaro.Benes
 
[[Category:VCL]]
 
[[Category:VCL]]
 
[[Category:System Unit]]
 
[[Category:System Unit]]

Revision as of 16:34, 12 September 2021

This page is intended as a supplement to the official documentation on Delphi programming. CodeGear is in the process of putting the Delphi documentation on the Web. Once they have done so, this page will link to the relevant page in the official documentation.
Stub
This article is a stub.
Please help enhance the Delphi Programming Wiki by expanding it.
Info
see the VCL Documentation Guidelines for an overview on doc pages

Unit

Description

The CompilerVersion constant identifies the internal version number of the Delphi compiler. It is defined in the System unit and may be referenced either in code just as any other constant.

Technical Comments

The CompilerVersion constant was introduced in Delphi 6 along with conditional expressions. In earlier Delphi versions various compiler defined VERxxx symbols are used to determine compiler versions.

CompilerVersion values and the equivalent compiler defined symbols for the Delphi versions in which the CompilerVersion constant is defined are:

Compiler CompilerVersion

Defined Symbol

Delphi 11.0 Alexandria 35 VER350
Delphi 10.4 Sydney 34 VER340
Delphi 10.3 Rio 33 VER330
Delphi 10.2 Tokyo 32 VER320
Delphi 10.1 Berlin 31 VER310
Delphi 10 Seattle 30 VER300
Delphi XE8 29 VER290
Delphi XE7 28 VER280
Delphi XE6 27 VER270
AppMethod 1 26.5 VER265
Delphi XE5 26 VER260
Delphi XE4 25 VER250
Delphi XE3 24 VER240
Delphi XE2 23 VER230
Delphi XE 22 VER220
Delphi 2010 21 VER210
Delphi 2009 20 VER200
Delphi 2007 .NET 19 VER190
Delphi 2007 18.5 VER185 (also VER180)
Delphi 2006 18 VER180
Delphi 2005 17 VER170
Delphi 8 .NET 16 VER160
Delphi 7 15 VER150
Delphi 6 14 VER140
Delphi 5 13(*) VER130
Delphi 4 12(*) VER120
Delphi 3 10(*) VER100
Delphi 2 9(*) VER90
Delphi 1 8(*) VER80

(*) These versions did not have a CompilerVersion constant, it was introduced with Delphi 6.

Examples

if CompilerVersion = 20 then
  sCompilerName := 'Delphi 2009';

or in conditional compiler expressions:

{$if CompilerVersion > 18}
  // Delphi 2007 or later
{$ifend}

See Also

User Comments/Tips

(Please leave your name with your comment.)

Added D2010, Uffe Kousgaard
Added Delphi XE, Steven Kamradt
Added Delphi 2007.NET by Jaro.Benes
Added Delphi XE3 by Jaro.Benes