Thanks, I will look at the suggestions

Mattias Gaertner wrote:
On Wed, 03 Mar 2010 21:33:45 +0200
Wimpie Nortje <wimpienor...@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@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to