Hello. I have an .inc file which contains

Hello. I have an .inc file which contains
...
  {$IF (CompilerVersion >= 14)} {$DEFINE Delphi6} {$DEFINE Delphi6up} {$IFEND}
  {$IF (CompilerVersion >= 15)} {$UNDEF Delphi6} {$DEFINE Delphi7} {$DEFINE Delphi7up} {$IFEND}
...
Delphi 7 compiler gives an error "constant expression expected". What am I missing here?
Thank you.

Comments

  1. If memory serves, the VERXXX goes back to D1, and it's likely it always works. CompilerVersion is apparently a defined constant, and was /supposedly/ introduced in D6.

    ReplyDelete
  2. Bill Meyer
    VERxxx even goes back to Turbo Pascal I think
     :)

    ReplyDelete
  3. Stefan Meisner I think you are correct in that. All the more reason to use it rather than CompilerVersion.

    ReplyDelete

Post a Comment