[Lazarus] Determining Laz/fpc version without using LCLVersion

Werner Pamler werner.pamler at freenet.de
Tue Jan 13 23:50:10 CET 2015


 > Maybe you can use two units for compatibility: one (e.g. FPCFixes) 
for the
 > non visual parts that solely relies on FPC provided functionality. There
 > you can use FPC_VERSION and friends to determine the compiler. The other
 > unit (e.g. LazFixes) is only used for the visual components and thus can
 > use LazVersion without problems.

I am already using LCLVersion in the package with the visual components 
since it already depends on LCL anyway. The problem is the central 
spreadsheet package (spreadsheet data structure, file readers/writers, 
formula engine, etc) which I want to keep as slim as possible because 
there are certainly console applications which do not need the LCL. In 
particular, the spreadsheet formula implementation requires UTF8 
functions (e.g. UTF8LeftStr() for the spreadsheet formula "=LEFT(...)") 
which are not yet contained in the LazUtf8 of older Lazarus versions 
(1.0). The package LazUtils which contains LazUtf8 does not depend on 
LCL, only on FCL. Therefore I thought that something like 
"LCL_fullversion" from LCLVersion would be a good indicator. Or is there 
something similar in the LazUtils package directly?




More information about the Lazarus mailing list