[fpc-pascal] Determining procedure's name

Wimpie Nortje wimpienortje at gmail.com
Thu Mar 4 06:46:19 CET 2010


Thanks, I will look at the suggestions

Mattias Gaertner wrote:
> On Wed, 03 Mar 2010 21:33:45 +0200
> Wimpie Nortje <wimpienortje at gmail.com> wrote:
>
>   
>> Hello everybody,
>>
>> Is there a macro or function that gives the current procedure's name?
>>
>> E.g.
>>
>> procedure TClass.SomeProc;
>> begin
>>   writeln(Format('This procedure's name is %s', [THE_MACRO]));
>> end;
>>     
>
> If you use Lazarus you can create a code template. Then you can type w
> plus Ctrl+J and you will get:
>
>   writeln(Format('This procedure's name is %s', ['TClass.SomeProc']));
>
> I prefer
>   writeln('TClass.SomeProc '|);
>
> The | symbol is where the cursor is positioned after the template was
> added.
>
>  
>   
>> should print
>>
>> This procedure's name is TClass.SomeProc
>>
>> or
>>
>> This procedure's name is SomeProc
>>     
>
>
> Mattias
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20100304/86ecce34/attachment.html>


More information about the fpc-pascal mailing list