CnPack Forum » CnWizards IDE Wizards » %ArgList% and %Arguments% don't work with current procedure


2008-11-7 06:28 harghh
%ArgList% and %Arguments% don't work with current procedure

Hi!

When I try to insert one of these macros while the cursor is INTO a procedure the parameters of the NEXT procedure are used. This is not a big problem, but annoying.

Example:

procedure TMyClass.Remove(const AID: Integer);
begin
  // using %ArgList% or %Arguments% here result in "Value" parameter
end;

procedure TMyClass.SetMode(const Value: Integer);
begin
  // ....
end;

Also it would be great if another macro exists (%CurrMethodName% ?) which is only the name of the method, without the name of the class. Ie 'SetMode' instead of 'TMyClass.SetMode'.

Thank you for your wonderful tools!

Harghh

2008-11-7 23:40 Passion
The %ArgList% and %Arguments% means NEXT procedure's ones. We should add %CurrArgList% and %CurrArguments% to the macros, but it's not so easy due to our design limitation.

But we can add a %CurrMethodName% quickly for a method name without a classname.

The coming 0.8.9.459 nightly build version will contain this enhancement.

[url]http://www.cnpack.org/downbuilds.php[/url]

2008-11-8 21:28 harghh
Thank you for your reply and for adding %CurrMethodName%!

By curiosity, what make it difficult to implements %CurrArgList% and %CurrArguments%?
I would eventualy want to modify CnPack myself to add them but I need to understand how it work first.

Also, is there a workaround for "simulating" %CurrArgList% and %CurrArguments%?
For example a shorcut which will jump from the body of the procedure to BEFORE the procecure, use %CurrArgList%, and move generated text to the body of the procedure?
It may be something doable with Pascal Script.
What do you think?

2008-11-11 20:05 Passion
We use mwPasLex to parse the pascal code. But it's not implemented or wrapped in Pascal Script due to Pascal Script's grammar limitation. So now in Pascal Script we can't parse the code as needed. We can only call some wrapped function in CnWizards.:L

页: [1]


Powered by Discuz! Archiver 5.0.0  © 2001-2006 Comsenz Inc.