Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Delphi7 compiler version

42 views
Skip to first unread message

Alex

unread,
Jul 16, 2003, 3:34:44 PM7/16/03
to

What version Delphi7 compiler has? I need it for conditional compilation.

Thanks

Brian Hollister

unread,
Jul 16, 2003, 5:26:50 PM7/16/03
to
I believe its VER150.

"Alex" <arod...@narod.ru> wrote in message
news:3f15a8d4$1...@newsgroups.borland.com...

Larry Siemer

unread,
Jul 16, 2003, 5:56:27 PM7/16/03
to
{$IFDEF VER150}
{$DEFINE Delphi7}
{$ENDIF}

"Alex" <arod...@narod.ru> wrote in message
news:3f15a8d4$1...@newsgroups.borland.com...
>

John Herbster (TeamB)

unread,
Jul 16, 2003, 6:03:13 PM7/16/03
to

"Larry Siemer" <lsi...@infi.net> wrote

> {$IFDEF VER150}
> {$DEFINE Delphi7}
> {$ENDIF}

That is making it too simple! <g>

How do you define "Delph5+" ?


a

unread,
Jul 16, 2003, 11:59:20 PM7/16/03
to
John,

{$IFDEF VER130} // delphi 5
{$DEFINE Dephi5Plus}
{$ENDIF}
{$IFDEF VER140} // delphi 6
{$DEFINE Dephi5Plus}
{$ENDIF}
{$IFDEF VER150} // delphi 7
{$DEFINE Dephi5Plus}
{$ENDIF}

Thanks,

Brett

"John Herbster (TeamB)" <herb-sci1_at_sbcglobal.net> wrote in message
news:3f15cafc$1...@newsgroups.borland.com...

Mike O'Hanlon

unread,
Jul 17, 2003, 3:41:50 AM7/17/03
to
Here you are!

{$IFDEF VER80}
{$DEFINE DELPHI_1}
{$DEFINE DELPHI_1_OR_2}
{$ELSE}
{$IFDEF VER90}
{$DEFINE DELPHI_2}
{$DEFINE DELPHI_1_OR_2}
{$ELSE}
{$IFDEF VER100}
{$DEFINE DELPHI_3}
{$ELSE}
{$DEFINE DELPHI_4_OR_LATER}
{$IFDEF VER120}
{$DEFINE DELPHI_4}
{$ELSE}
{$DEFINE DELPHI_5_OR_LATER}
{$IFDEF VER130}
{$DEFINE DELPHI_5}
{$ELSE}
{$DEFINE DELPHI_6_OR_LATER}
{$IFDEF VER140}
{$DEFINE DELPHI_6}
{$ELSE}
{$DEFINE DELPHI_7_OR_LATER}
{$IFDEF VER150}
{$DEFINE DELPHI_7}
{$ELSE}
{$DEFINE DELPHI_8_OR_LATER}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}

Mike O'Hanlon

Maël Hörz

unread,
Jul 17, 2003, 11:28:08 AM7/17/03
to
Hello Alex,
Have a look at the Jedi Code Library.
It contains a file "JEDI.inc" that is always up to date and defines
Conditionals for every Delphi/C++Builder-Version.

Regards, Maël.

"Alex" <arod...@narod.ru> schrieb im Newsbeitrag
news:3f15a8d4$1...@newsgroups.borland.com...

John Herbster (TeamB)

unread,
Jul 17, 2003, 11:45:41 AM7/17/03
to
> "John Herbster (TeamB)" wrote

> > How do you define "Delph5+" ?
>
"a" wrote

> {$IFDEF VER130} // delphi 5
> {$DEFINE Dephi5Plus}
> {$ENDIF}
> {$IFDEF VER140} // delphi 6
> {$DEFINE Dephi5Plus}
> {$ENDIF}
> {$IFDEF VER150} // delphi 7
> {$DEFINE Dephi5Plus}
> {$ENDIF}

Brett, I was wishing for a way that would not require
modification of the source when Delphi8 came out.
I knew that I was difficult. It *is* possible to define
Delphi3Minus, Delphi4Minus, etc. It would be nice if
we could do greater-than and less-than test on "defines".
Rgds, JohnH


Finn Tolderlund

unread,
Jul 17, 2003, 4:21:00 PM7/17/03
to
I'm with you on that one.
It would be very usefull.
--
Finn Tolderlund


"John Herbster (TeamB)" <herb-sci1_at_sbcglobal.net> skrev i en meddelelse
news:3f16c3f7$1...@newsgroups.borland.com...


> Brett, I was wishing for a way that would not require
> modification of the source when Delphi8 came out.

Brad White

unread,
Jul 17, 2003, 5:09:13 PM7/17/03
to
"John Herbster (TeamB)" <herb-sci1_at_sbcglobal.net> wrote in message
news:3f16c3f7$1...@newsgroups.borland.com...

> Brett, I was wishing for a way that would not require
> modification of the source when Delphi8 came out.
> I knew that I was difficult. It *is* possible to define
> Delphi3Minus, Delphi4Minus, etc. It would be nice if
> we could do greater-than and less-than test on "defines".
> Rgds, JohnH
>

John,

Your posts are usually pretty sensible,
but I don't know if I can go down this
road with you.
How do you define 'greater than' on defines?

If you don't want to go with a common public
ver file, I think rolling your own is a better approach
than changing the language.

{ VER80 Delphi 1.0
VER90 Delphi 2.0
VER93 C++Builder 1.0
VER100 Delphi 3.0
VER110 C++Builder 3.0
VER120 Delphi 4.0
VER125 C++Builder 4.0
VER130 Delphi 5.0
VER135 C++Builder 5.0
VER140 Delphi 6.0
VER150 Delphi 7.0
}

{$IFDEF VER80}
{$DEFINE DELPHI1}
{$ENDIF}
{$IFDEF VER90}
{$DEFINE DELPHI2}
{$ENDIF}
{$IFDEF VER93}
{$DEFINE BCB1}
{$ENDIF}
{$IFDEF VER100}
{$DEFINE DELPHI3}
{$ENDIF}
{$IFDEF VER110}
{$DEFINE BCB3}
{$ENDIF}
{$IFDEF VER120}
{$DEFINE DELPHI4}
{$ENDIF}
{$IFDEF VER125}
{$DEFINE BCB4}
{$ENDIF}
{$IFDEF VER130}
{$DEFINE DELPHI5}
{$ENDIF}
{$IFDEF VER135}
{$DEFINE BCB5}
{$ENDIF}
{$IFDEF VER140}
{$DEFINE DELPHI6}
{$ENDIF}
{$IFDEF VER150}
{$DEFINE DELPHI7}
{$ENDIF}

{$IFDEF WIN32}
{$DEFINE D2_OR_HIGHER}
{$ENDIF}

{$IFNDEF DELPHI1}
{$IFNDEF DELPHI2}
{$IFNDEF BCB1}
{$DEFINE D3_OR_HIGHER}
{$IFNDEF DELPHI3}
{$DEFINE BCB3_OR_HIGHER}
{$IFNDEF BCB3}
{$DEFINE D4_OR_HIGHER}
{$IFNDEF DELPHI4}
{$DEFINE BCB4_OR_HIGHER}
{$IFNDEF BCB4}
{$DEFINE D5_OR_HIGHER}
{$IFNDEF DELPHI5}
{$DEFINE BCB5_OR_HIGHER}
{$IFNDEF BCB5}
{$DEFINE D6_OR_HIGHER}
{$IFNDEF DELPHI6}
{$DEFINE D7_OR_HIGHER}


{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}
{$ENDIF}

{$ENDIF}
{$ENDIF}
{$ENDIF}


--
Thanks,
Brad White


John Herbster (TeamB)

unread,
Jul 17, 2003, 5:44:11 PM7/17/03
to

"Brad White" <bwh...@asiweb.com> wrote

> How do you define 'greater than' on defines?

That *is* the problem.

Maybe Borland could let have some of these built into the
compiler, like

In compiler VER16 it could define
Delphi8, Delphi8Plus, Delphi7Plus, Delphi6Plus, Delphi5Plus, & etc.
In compiler VER15 it would define
Delphi7, Delphi7Plus, Delphi6Plus, Delphi5Plus, & etc.
In compiler VER14 it would define
Delphi6, Delphi6Plus, Delphi5Plus, & etc....
And etc. down to
In compiler VER90 it would define
Delphi2, Delphi2Plus, and Delphi1Plus

In compiler VER80 it would define
Delphi1 and Delphi1Plus

I have left out a lot, but I hope that you can see the pattern.
Regards, JohnH


Peter Thörnqvist

unread,
Jul 17, 2003, 7:42:05 PM7/17/03
to
> It would be nice if
> we could do greater-than and less-than test on "defines".
Even if Borland adds support for ">" and "<" in D8 it won't help when
compiling with D7 and earlier (and that's the whole point of having those
defines in the first place), so you would still be forced to use the method
Brett showed.

--
Regards,

Peter Thornqvist (JVCL Coordinator)
http://jvcl.sourceforge.net


a

unread,
Jul 18, 2003, 3:39:54 PM7/18/03
to
John,

Flip your logic.

{$IFDEF VER120} // delphi 4
{$DEFINE Delphi4Minus}
{$ENDIF}
{$IFDEF VER110} // delphi 3
{$DEFINE Delphi4Minus}
{$ENDIF}
... etc.

Then use:
{$IFNDEF Delphi4Minus}
// you code
{$ENDIF}

When Delphi 8, 9, etc. comes out, then the code will
be included.

What you are really saying is you want code
included if you are not using Delphi4 and lower?
The above works fine.

> would be nice if we could do greater-than and less-than
>test on "defines".

No. If Delphi added this in say Delphi8 and you used it,
then it would ensure that your code wouldn't compile under
Delphi 7, 6, 5, etc. anyway because the older compilers
wouldn't know that "IFDEF_LESS_THAN" was anyway.
i.e.

{$IFDEF_LESS_THAN VER160}
// pointless, a D7- compiler won't buy it anyway.
{$END}

Might as well just say:

{$IFDEF Delphi7Minus}
This project may not be compiled except under Delphi 8+.
{$ENDIF}


Thanks,

Brett

"John Herbster (TeamB)" <herb-sci1_at_sbcglobal.net> wrote in message

news:3f16c3f7$1...@newsgroups.borland.com...

John Herbster (TeamB)

unread,
Jul 18, 2003, 3:56:20 PM7/18/03
to

JohnH wrote:
> > It *is* possible to define Delphi3Minus, Delphi4Minus,

"a" <blwa...@shaw.ca> wrote
> Flip your logic.

That is what I meant and thought that I was saying.

> > would be nice if we could do greater-than and less-than
> >test on "defines".

> No. If Delphi added this in say Delphi8 and you used it,
> then it would ensure that your code wouldn't compile under
> Delphi 7, 6, 5, etc. anyway because the older compilers

True. What I meant to imply is that if way back in the
beginning of conditional compilation flags, they had allowed
greater and less than comparisons, it might have helped.

Rgds, JohnH


Maël Hörz

unread,
Jul 21, 2003, 9:28:19 AM7/21/03
to
> > would be nice if we could do greater-than and less-than
> >test on "defines".

Perhaps I missed something but this feature already is there in Delphi 7 (at
least) why not use (for never compilers) the defined CompilerVersion and
RTLVersion consts.
Like this
{$IF RTLVersion >= 15} for Delphi 7.

For more ease you could define.
const
DelphiVer = CompilerVersion - 8;
And do a test with this. {$IF DelphiVer >= 7}

Delphi 3 also supports $IF-directive so you could define DelphiVer using the
old defines and then use $IF to distinguish easily between the versions
where you need.

Wouldn't that work?

Regards Maël.


John Herbster (TeamB)

unread,
Jul 21, 2003, 10:09:27 AM7/21/03
to

"Maël Hörz" <ma...@web.de> wrote

> Perhaps I missed something but this feature already
> is there in Delphi 7 (at least) why not use (for newer

> compilers) the defined CompilerVersion and
> RTLVersion consts.

No, Maël, you were not missing anything. I was. How
did you happen to discover this? Regards, JohnH

By the way
"If RTLVersion > 15 then ...;"
May be optimized out *by the complier* for versions
15 or less, so that the test may be done at compile-time
rather than at run time.


Maël Hörz

unread,
Jul 21, 2003, 11:56:45 AM7/21/03
to
Hello John,

> No, Maël, you were not missing anything. I was. How
> did you happen to discover this? Regards, JohnH
I go from time to time through RTL/VCL source. However I'm not shure that my
results are that glorious.
There is a problem. I noticed that $IF in Delphi 3 does not work as
expected.
Have a look at the thread "$IF-directive" at objectpascal:
Perhaps the Delphi3-Help meant with $IFxxx the two directives $IFDEF and
$IFNDEF?

> By the way
> "If RTLVersion > 15 then ...;"
> May be optimized out *by the complier* for versions
> 15 or less, so that the test may be done at compile-time
> rather than at run time.

I tested. It IS optimized out.
If you don't like this you can define a variable that "hides" the consts:
var
RTLVersion: Extended = System.RTLVersion; //same works for compilerversion
then there is no optimization done.

Conclusion:
If $IF does not work in Delphi < 6 we cannot use CompilerVersion for
conditional typedefinitions:
{$IF CompilerVersion = 3}
type
Int64 = TLargeInteger;
{$IFEND}
We still would need to use $IFDEF :-(

Regards, Maël.


Jeff Overcash (TeamB)

unread,
Jul 21, 2003, 9:08:48 PM7/21/03
to

"Maël Hörz" wrote:
>
> I noticed that $IF in Delphi 3 does not work as
> expected.

This directive was introduced in D6.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
If there is somebody up there could they throw me down a line. Just a
little helping hand just a little understanding. Just some answers to the
questions that surround me now. If there's somebody up there could
they throw me down a line. (Fish)

0 new messages