%ArgList% and %Arguments% don't work with current procedure
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.
procedure TMyClass.Remove(const AID: Integer);
// using %ArgList% or %Arguments% here result in "Value" parameter
procedure TMyClass.SetMode(const Value: Integer);
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!
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.
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?
Powered by Discuz! Archiver 5.0.0
© 2001-2006 Comsenz Inc.
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