Hi Peter,
> I need to modify code that runs well in Delphi 3, but that fails in Delphi 5
> (due to changed behaviour in some VCL components). Is there a predefined
> symbol in the compiler that identifies the Delphi version (like when we
> migrated from 16 bit to 32 bit, we could compile using {$IFDEF WIN32}). I
> tried {$IFDEF Delphi5}, but that doesn't exist.
There's a list of VERxxx defined compiler options that you can check...
When Delphi 1 shipped, it was numbered version 8, because it was the 8th
edition of the (Pascal) compiler. Delphi 2 was version 9 and C++Builder
was number version 9.3 (i.e. only a .3 version increase). Later, Borland
regretted that decision, and C++Builder 3 resulted in a full increase of
compiler version number. Only to change it's mind again with C++Builder
4, which is only good for half a version number upgrade. And as of
version 5 of Delphi and C++Builder they both even share the same
compiler version 13.
Product version Compiler version
Delphi 1 VER80
Delphi 2 VER90
C++Builder VER93
Delphi 3 VER100
C++Builder 3 VER110
Delphi 4 VER120
C++Builder 4 VER125
Delphi 5 VER130
C++Builder 5 VER130
You can use these compiler versions in your Object Pascal source code as
follows:
{$IFDEF VER130}
// Delphi 5 or C++Builder 5
{$ENDIF}
> Peter Laman
Groetjes,
Bob Swart (aka Dr.Bob - www.drbob42.com)
--
drs. Robert E. (Bob) Swart, @-Consultant, Delphi Trainer & Author
Delphi OplossingsCentrum (DOC) & UK-BUG Borland User Group member