[Lazarus] Conditional code based on Lazarus/LCL version

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Conditional code based on Lazarus/LCL version

Denis Kozlov
Hi,

Is there something like FPC_VERSION define but for Lazarus or LCL, e.g.
LAZARUS_VERSION?

I need a way of programmatically determining which version of Lazarus or
LCL is/was used to compile the program, preferably at compile time, but
at run time could also be useful.

P.S. Most of mailing list emails still don't arrive to gmail account,
I'll keep monitoring list archive.

Thanks,
Denis
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Conditional code based on Lazarus/LCL version

Mattias Gaertner
On Thu, 22 Sep 2016 21:30:51 +0100
Denis Kozlov <[hidden email]> wrote:

> Hi,
>
> Is there something like FPC_VERSION define but for Lazarus or LCL, e.g.
> LAZARUS_VERSION?

See unit lclversion.

Mattias
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Conditional code based on Lazarus/LCL version

Denis Kozlov
On 22/09/2016 22:02, Mattias Gaertner wrote:
> See unit lclversion.

Thanks! Somehow I just couldn't find it.

Is it theoretically possible to implement a compile time define for
Lazarus version?

Perhaps an extra define that Lazarus passes to compiler automatically?

Thanks,
Denis
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Conditional code based on Lazarus/LCL version

Mattias Gaertner
On Thu, 22 Sep 2016 22:25:23 +0100
Denis Kozlov <[hidden email]> wrote:

> On 22/09/2016 22:02, Mattias Gaertner wrote:
> > See unit lclversion.  
>
> Thanks! Somehow I just couldn't find it.
>
> Is it theoretically possible to implement a compile time define for
> Lazarus version?

You can use it at compile time:

uses lclversion;
{$IF lcl_minor=7}
...

It is just that codetools do not support such constants. The compiler
does.

Mattias
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Conditional code based on Lazarus/LCL version

Lars
In reply to this post by Denis Kozlov
On Thu, September 22, 2016 2:30 pm, Denis Kozlov wrote:
> Hi,
...
> P.S. Most of mailing list emails still don't arrive to gmail account,
> I'll keep monitoring list archive.


Are you sure they are not hidden in some tab, like social, or such. I
don't use Gmail much, just as dummy accounts sometimes, but when I did use
it I found a lot of my mail obnoxiously disappeared into hidden tabs like
social or whatever that tab is called... so the emails do not appear in
your main view but you have to find them.  And obviously, you've checked
Junk folders...


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus