(Added Delphi XE) |
|||
Line 20: | Line 20: | ||
==Technical Comments== |
==Technical Comments== |
||
+ | |||
<div class="VclTechnicalComments"> |
<div class="VclTechnicalComments"> |
||
The CompilerVersion constant was introduced in Delphi 6. In earlier Delphi versions various compiler defined VERxxx symbols are used to determine compiler versions. |
The CompilerVersion constant was introduced in Delphi 6. In earlier Delphi versions various compiler defined VERxxx symbols are used to determine compiler versions. |
||
Line 26: | Line 27: | ||
Compiler Version Compiler Defined Symbol |
Compiler Version Compiler Defined Symbol |
||
+ | Delphi XE 22 VER220 |
||
Delphi 2010 21 VER210 |
Delphi 2010 21 VER210 |
||
Delphi 2009 20 VER200 |
Delphi 2009 20 VER200 |
Revision as of 22:06, 6 October 2010
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:
if CompilerVersion = 20 then sCompilerName := 'Delphi 2009';
or in conditional compiler expressions:
{$if CompilerVersion > 18} // Delphi 2007 or later {$ifend}
Technical Comments
The CompilerVersion constant was introduced in Delphi 6. 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 Version Compiler Defined Symbol Delphi XE 22 VER220 Delphi 2010 21 VER210 Delphi 2009 20 VER200 Delphi 2007 18.5 VER185 Delphi 2006 18 VER180 Delphi 2005 17 VER170 Delphi 8 16 VER160 Delphi 7 15 VER150 Delphi 6 14 VER140
Examples
(Please provide links to articles/source code that show how to use this item.)
See Also
User Comments/Tips
(Please leave your name with your comment.)
Added D2010, Uffe Kousgaard