Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-09

Conditional code based on Lazarus/LCL version

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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

Reply by email

Denis Kozlov
to Mattias Gaertner
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

Reply by email

Mattias Gaertner
to Denis Kozlov
Show quoted text 7 lines
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

Reply by email

Lars
to Denis Kozlov: Is there something like FPC_VERSION define but for Lazarus or LCL, e.g. LAZARUS_VERSION?…
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...

Reply by email