In Delphi 2010, if I want to do this:
{$IFDEF VER999}
//some delphi 2010-specific code here
{$ENDIF}
What version # do I need to use in place of "999"?
Here's the list of compiler versions:
{$IFDEF VER40} - Turbo pascal 4
{$IFDEF VER50} - Turbo pascal 5
{$IFDEF VER55} - Turbo pascal 5.5
{$IFDEF VER60} - Turbo pascal 6
{$IFDEF VER70} - Borland pascal 7 (And turbo pascal 1.5 for windows)
{$IFDEF VER80} - Delphi 1
{$IFDEF VER90} - Delphi 2
{$IFDEF VER100} - Delphi 3
{$IFDEF VER120} - Delphi 4
{$IFDEF VER130} - Delphi 5
{$IFDEF VER140} - Delphi 6
{$IFDEF VER150} - Delphi 7
{$IFDEF VER160} - Delphi 8
{$IFDEF VER170} - Delphi 2005
{$IFDEF VER180} - Delphi 2006
{$IFDEF VER180} - Delphi 2007
{$IFDEF VER185} - Delphi 2007
{$IFDEF VER200} - Delphi 2009
{$IFDEF VER210} - Delphi 2010
{$IFDEF VER220} - Delphi XE
{$IFDEF VER230} - Delphi XE2
{$IFDEF VER240} - Delphi XE3
{$IFDEF VER250} - Delphi XE4
{$IFDEF VER260} - Delphi XE5
{$IFDEF VER265} - Appmethod 1.0
{$IFDEF VER270} - Delphi XE6
{$IFDEF VER280} - Delphi XE7
{$IFDEF VER290} - Delphi XE8
{$IFDEF VER300} - Delphi 10 Seattle
{$IFDEF VER310} - Delphi 10.1 Berlin
{$IFDEF VER320} - Delphi 10.2 Tokyo
In Delphi 2007, VER180
and VER185
are both defined. This was for backward compatibility with Delphi 2006, and to make sure you could also detect D2007 specifically.
I'm not sure why they did that between '06 and '07, but not for other releases. Seems inconsistent to me (but it isn't - see Barry Kelly's comment below).