[Lazarus] Get LCL revision or version via ifdef

Hans-Peter Diettrich DrDiettrich1 at aol.com
Wed Oct 5 02:20:30 CEST 2011


cobines schrieb:
> 2011/10/4 silvioprog <silvioprog at gmail.com>:
>> I'm needing to use in the uses clause, as I showed in my first
>> example. But in the uses clause the FPC is not accepting the
>> compilation.
> 
> I think it is not possible as it seems the constants are not declared
> while in the interface uses section. You can use it in the uses
> implementation section. Checked with FPC trunk too.
> 
> unit test2;
> {$mode objfpc}{$H+}
> interface
> uses
>   LCLVersion
>   {$IF DECLARED(lcl_fullversion)}
>   {$ERROR interface}
>   {$ENDIF}
>   ;

Perhaps the used unit is not parsed until a separator token (',' or ';') 
  has been parsed. What if you try:

 > uses
 >   LCLVersion
     ,
 >   {$IF DECLARED(lcl_fullversion)}
 >   {$ERROR interface}
 >   {$ENDIF}
     SysUtils
 >   ;

DoDi





More information about the Lazarus mailing list