So, while installing my copy of ICS (currently used in D2009 and
D2010) in Delphi XE, the compile dies on:

    Bomb('This component requires Delphi 7 or later');

Which reminds me of one of my pet peeves regarding third-party
components and Delphi upgrades:
Why can't component vendors use more reliable means of detecting
versions of Delphi?  Since Delphi 6 introduced conditional compiler
expressions (CompilerVersion, RTLVersion), I avoid VER constants
whenever possible.

I was recently talking to Ray Konopka about this.  He pointed out a
legitimate concern that CompilerVersion, RTLVersion, and the VER
constants are independent and reflect different information.  For
example, he points out that CompilerVersion, RTLVersion, and the VER
constants are inconsistent.  I can see his point, and for a component
library that requires very specific knowledge of the TCustom*
components, there may be a need to check VER defines specifically.

However, VER is documented as "indicating the version number of the
Delphi compiler"
 And so far, CompilerVersion has worked very well for me (for
detection of Delphi 6 and up, of course).

Ray still uses the VER defines.  However, he tests for every known
define.  If, at the end of the tests, no known defines are known, then
he assumes that the compiler supports the latest version that his code
is aware of.  For example, here is an excerpt from RZCOMPS.INC (which
Ray told me anyone is free to use):

// VER210 (RAD Studio 2010)

// If compiler version is unknown, assume to be VER210



// Make your Delphi 2010 defines here

So, when compiling this code for Delphi XE, the code assumes that the
compiler/VCL is compatible with Delphi 2010.  In general, a fairly
safe assumption.  Delphi 2009 is the one major exception I can think
of where this could have caused problems.

Jon Robertson
Borland Certified Advanced Delphi 7 Developer
Good programming is 40% experience, 30% skill, 20% RTFM, 10% caffeine,
and 5% attention to detail.
To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to