Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-11

Setter code

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

José Mejuto

Hello,

Is there any way to change the code generated when autocomplete a Setter in a class ?

Currently it generates something like:

procedure Tfrm.SetMyproperty(AValue: string);
begin
   if FMyProperty = AValue then exit;
   FMyProperty := AValue;
end;

And I need to change it (for conveniece) to something like:

procedure Tfrm.SetMyproperty(AValue: string);
begin
   if FMyProperty = AValue then exit;
   debugln('property changed');
   FMyProperty := AValue;
end;

Thank you.

Reply by email

Mattias Gaertner
to José Mejuto
Show quoted text 21 lines
Hello, Is there any way to change the code generated when autocomplete a Setter in a class ? Currently it generates something like: procedure Tfrm.SetMyproperty(AValue: string); begin if FMyProperty = AValue then exit; FMyProperty := AValue; end; And I need to change it (for conveniece) to something like: procedure Tfrm.SetMyproperty(AValue: string); begin if FMyProperty = AValue then exit; debugln('property changed'); FMyProperty := AValue; end;

No.
But it is open source so you can patch it.
See components/codetools/codecompletion.pas line 6720.

Mattias

Reply by email

José Mejuto
to Mattias Gaertner

El 03/11/2012 23:39, Mattias Gaertner escribi?:

Show quoted text 5 lines
No. But it is open source so you can patch it. See components/codetools/codecompletion.pas line 6720.

Hello,

Thank you. I was looking for the relevant piece of code for more than one hour without success, in fact I was looking for in the wrong source codes (IDE).

Reply by email

Sven Barth
to Mattias Gaertner: On Sat, 03 Nov 2012 19:03:50 +0100 No. But it is open source so you can patch it. See…
Mattias Gaertner wrote 28 lines
On Sat, 03 Nov 2012 19:03:50 +0100 Jos? Mejuto wrote: > Hello, > > Is there any way to change the code generated when autocomplete a Setter > in a class ? > > Currently it generates something like: > > procedure Tfrm.SetMyproperty(AValue: string); > begin > if FMyProperty = AValue then exit; > FMyProperty := AValue; > end; > > And I need to change it (for conveniece) to something like: > > procedure Tfrm.SetMyproperty(AValue: string); > begin > if FMyProperty = AValue then exit; > debugln('property changed'); > FMyProperty := AValue; > end; No. But it is open source so you can patch it. See components/codetools/codecompletion.pas line 6720.

Please note that I had already reported a feature request for this in March 2010 :)

http://bugs.freepascal.org/view.php?id=15922

Regards,
Sven

Reply by email