[Lazarus] registersqldb.pas Cannot find "LResources"

Andrew Brunner andrew.t.brunner at gmail.com
Mon Oct 25 01:58:59 CEST 2010


On Sun, Oct 24, 2010 at 03:44:47PM +0000, Mark Morgan Lloyd wrote:
> >> Is it possible to get the original name of a project by doing something like
> >>
> >> scratch:= {$I %PROJFILE% };
> > 
> > Free Pascal doesn't know about projects, but can inline custom environment
> > variables that way, if Lazarus would set them before running the compiler.
> 
> I use (*$IFDEF LCLGTK2 *) etc. in an "about" box, together with e.g. 
> (*$I %FPCVERSION% *) and (*$I %DATE% *).

An ifdef is a different beast from a {$i }. Defines are set on the cmdline
(e.g. -dLCLGTK2 in the above case), while $I are 

either built in (FPCVERSION, DATE, the easiest is to look up the
{$i %..%} syntax in the manual for a list)

_or_ an environmentvariable. This can be used to pass content like this, but
means that lazarus has to set them in the environment that FPC calls.

The advantage of this, is that it will work with any 2.x FPC version.

> Noting that somebody was asking about getting the LCL version a few days 
> ago, where I've had to do this I tend to rely on having a fairly tight 
> fit between FPC and LCL versions.

FPC doesn't know anything about LCL or Lazarus, let alone its exact
versioning.  But it can regurgitate information it gets passed _by_ Lazarus. 
Defines and {$I %environmentvariable%} are examples of this.





More information about the Lazarus mailing list