Forum > General

Absolute file path in {$include %file%}

(1/6) > >>

simone:
As know, {$include %file%} is expanded by compiler with the name of current source file. As far as I understand, the filename is without the path. Is there any way to get the full path name? Thank you.

MarkMLl:
Since your question is OS- and version-specific, I'd suggest putting that info in the body of your message, not in your sig (and in fact, editing your message to include those before anything else). The problem is that at some point your sig will change, and that will appear immediately in all historical messages thus destroying the context of the question for anybody who arrives here via a forum or Google search.

I don't believe there is a way of expanding %FILE% directly to a full path. There's various things you can do in the Lazarus IDE at the build settings level to get more info, but at the compiler level you're going to be restricted to whatever shell/environment variables your OS makes available (and please note my para above).

MarkMLl

simone:
My question was OS independent. However, thanks for the reply.

MarkMLl:

--- Quote from: simone on October 03, 2022, 10:50:37 am ---My question was OS independent. However, thanks for the reply.

--- End quote ---

Your question is NOT OS-independent since it depends on the shell/environment variables made available, and is NOT version-independent since the $I expansions might change.

MarkMLl

simone:
My question is os independent. The solution is os dependent.

Navigation

[0] Message Index

[#] Next page

Go to full version