Source file macro

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Source file macro

Ryan Joseph-2
Is there a macro for the path of the source file being compiled? I could swear there was something like FPC_SOURCE_FILE but I can’t find it now.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Source file macro

Виктор Матузенко
{$I %FILE%} ?

ср, 19 июн. 2019 г. в 17:49, Ryan Joseph <[hidden email]>:
Is there a macro for the path of the source file being compiled? I could swear there was something like FPC_SOURCE_FILE but I can’t find it now.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


--
Victor Matuzenko (Виктор Матузенко)

_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Source file macro

Ryan Joseph-2


> On Jun 19, 2019, at 10:52 AM, Виктор Матузенко <[hidden email]> wrote:
>
> {$I %FILE%} ?

Sorry I mean something like:

{$macro on}

writeln(FPC_SOURCE_FILE);

Looking for a string I can use.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Source file macro

gabor-10
try

writeln({$I %FILE%});

it really works ;)

Regards,
Michał

W dniu 2019-06-19 o 16:54, Ryan Joseph pisze:

>
>
>> On Jun 19, 2019, at 10:52 AM, Виктор Матузенко <[hidden email]> wrote:
>>
>> {$I %FILE%} ?
>
> Sorry I mean something like:
>
> {$macro on}
>
> writeln(FPC_SOURCE_FILE);
>
> Looking for a string I can use.
>
> Regards,
> Ryan Joseph
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Source file macro

Ryan Joseph-2


> On Jun 19, 2019, at 10:59 AM, gabor <[hidden email]> wrote:
>
> try
>
> writeln({$I %FILE%});
>
> it really works ;)
>
> Regards,
> Michał

Oh I see now. Strange syntax, never saw that before. Can you get the full path instead of just the name?

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Source file macro

gabor-10
W dniu 2019-06-19 o 17:10, Ryan Joseph pisze:
>
> Oh I see now. Strange syntax, never saw that before. Can you get the full path instead of just the name?
>
> Regards,
> Ryan Joseph
>
Unfortunately, just the name. But it's a good idea to be able to have a
full path.
You can get full listof directives here:
https://www.freepascal.org/docs-html/prog/progsu41.html

Regards,
Michał.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Source file macro

greim
Great, 
looking for this "Macro" for 15+ years

Kind Regards

Markus

On June 19, 2019, 5:35 PM GMT+2 [hidden email] wrote:

W dniu 2019-06-19 o 17:10, Ryan Joseph pisze:

>
> Oh I see now. Strange syntax, never saw that before. Can you get the full path instead of just the name?
>
> Regards,
> Ryan Joseph
>
Unfortunately, just the name. But it's a good idea to be able to have a
full path.
You can get full listof directives here:
https://www.freepascal.org/docs-html/prog/progsu41.html

Regards,
Michał.
_______________________________________________
fpc-pascal maillist - [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal