Delphi – finding the VERxxx define for a particular Delphi version: use JEDI.INC
Posted by jpluimers on 2009/10/15
Edit 20140822 since originally posting, JEDI moved to a GIT repository, so I changed some URLs and added that it is up to date until Delphi XE7.
Finding the correct VERxxx conditional define for a particular Delphi version is asked by a lot of people.
Even the first link in the above search, does not contain the full list!
But: JCL comes to the rescue
The JCL file JEDI.INC usually (read: like 99.999% of the time) is up to that with that information soon.
Currently, it contains all the defines starting with Delphi 1, up to Delphi 2010 XE7.
You can always browse the to JEDI.INC with this link to the sourceforge trunk. link to the GitHub master version.
In fact that file contains a lot more useful defines.
Actually, having the JCL and/or JVCL at hand is a very good practice: it is filled with high quality code that solves a lot of everyday problems.
Note:
VER190 (by some people attributed to the wrong Delphi version) is only used by Delphi 2007 for .NET (Delphi 2007 for Win32 used VER185 by itself and shares VER180 with Delphi 2006 for Win32).
The number 13 (in between Delphi 2009 aka Delphi 12, and Delphi 2010 aka Delphi 14) was never used as a Delphi version number
Since Delphi is mainly developed in the USA, and since a lot people there have Triskaidekaphobia, they showed mercy to those and skipped Delphi 13.
–jeroen






JEDI.INC got updated a few months ago: Delphi XE7 seems to be ahead… « The Wiert Corner – irregular stream of stuff said
[…] jpluimers on Delphi – finding the VER… […]
Xepol said
Still wishing these were part of the code insight system – it would be easy if the system just decided to show defined symbols when you were invoke in a comment context.
jpluimers said
Now that is a cool idea!
Did you report it through QC?
–jeroen
Rif said
With Firefox 3.x (on Windows and Linux) the blog headline overlaps the menu line. I would suggest to fix it as it does not look very pretty.
Doei RIF
jpluimers said
That’s probably the stylesheet on which I don’t have influence.
If your monitor is not wide enough, it’ll fail in most browsers.
Luckily most of the target audience has a high enough resolution.
–jeroen
Rif said
There is a list of Version numbers on the Delphi Wiki
http://delphi.wikia.com/wiki/Borland_Compiler_Conditional_Defines
Doei RIF
jpluimers said
Just checked: that list is also complete.
Even better: It also includes all the Turbo Pascal and C++ versions!
Thanks!
–jeroen
Jens Borrisholt said
{$IF CompilerVersion >= 14}
{$IF CompilerVersion = 14}
{$DEFINE DELPHI_6}
{$IFEND} //Delphi 6
{$DEFINE DELPHI_6_UP}
{$IFDEF LINUX}
{$DEFINE KYLIX}
{$IF RTLVersion = 14.2}
{$DEFINE KYLIX2}
{$DEFINE KYLIX2_UP}
{$IFEND}
{$IF RTLVersion = 14.5}
{$DEFINE KYLIX3}
{$DEFINE KYLIX3_UP}
{$IFEND}
{$ENDIF} //Linux
{$IFEND} //Delphi 6
{$IF CompilerVersion >= 15}
{$IF CompilerVersion = 15}
{$DEFINE DELPHI_7}
{$IFEND}
{$DEFINE DELPHI_7_UP}
{$IFEND} //Delphi 7
{$IF CompilerVersion >= 16}
{$IF CompilerVersion = 16}
{$DEFINE DELPHI_8}
{$IFEND}
{$DEFINE DELPHI_8_UP}
{$IFEND} //Delphi 8
{$IF CompilerVersion >= 17}
{$IF CompilerVersion = 17}
{$DEFINE DELPHI_9}
{$DEFINE DELPHI_2005}
{$IFEND}
{$DEFINE DELPHI_9_UP}
{$DEFINE DELPHI_2005_UP}
{$IFEND} //Delphi 9
{$IF CompilerVersion >= 18}
{$IF CompilerVersion = 18}
{$DEFINE DELPHI_10}
{$DEFINE DELPHI_2006}
{$IFEND}
{$DEFINE DELPHI_10_UP}
{$DEFINE DELPHI_2006_UP}
{$IFEND} //Delphi 10/2006
{$IF CompilerVersion >= 18.5}
{$IF CompilerVersion = 18.5}
{$DEFINE DELPHI_11}
{$DEFINE DELPHI_2007}
{$IFEND}
{$DEFINE DELPHI_11_UP}
{$DEFINE DELPHI_2007_UP}
{$IFEND} //Delphi 11/2007
{$IF CompilerVersion = 19}
{$DEFINE Delphi_NET_2007}
{$IFEND} //Delphi .NET 2007
{$IF CompilerVersion >= 20}
{$IF CompilerVersion = 20}
{$DEFINE DELPHI_12}
{$DEFINE DELPHI_2009}
{$IFEND}
{$DEFINE DELPHI_12_UP}
{$DEFINE DELPHI_2009_UP}
{$IFEND} //Delphi 12/2009
{$IF CompilerVersion >= 21}
{$IF CompilerVersion = 21}
{$DEFINE DELPHI_13}
{$DEFINE DELPHI_2010}
{$IFEND}
{$DEFINE DELPHI_13_UP}
{$DEFINE DELPHI_2010_UP}
{$IFEND} //Delphi 13/2010
jpluimers said
Why when you have JEDI.inc at https://github.com/project-jedi/jedi/blob/master/jedi.inc ?