[Lazarus] __FILE__ macro, or equivalent

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Fri Jul 29 19:47:40 CEST 2016


Donald Ziesig wrote:
> Hi All!
> 
> I would like to get the path to an fpc package at compile time. I have a 
> package which needs to load some .so files and I would like to store 
> them in a location that will be consistent when I move the package from 
> system to system.  By getting the package path, I could store them in 
> the package directory.
> 
> Is that possible?
> 
> I tried to use the __FILE__ macro like in C/C++ but the compiler doesn't 
> seem to understand it.

Try something like

B5k5_Project := {$I %FILE% } ;        (* Possibly used for .ini files 
etc.    *)

http://www.freepascal.org/docs-html/current/prog/progsu41.html#x48-470001.2.41

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]


More information about the Lazarus mailing list