[Lazarus] Component rename in lazarus...

Bo Berglund bo.berglund at gmail.com
Mon Feb 14 13:06:50 CET 2011


By accident I just discovered a feature of Lazarus that I was not
aware of:
I had misnamed a component and wanted to correct it, so I gave it a
new name in the property editor. Then I planned on going over the code
and change the places where the component was used to the new name.

But it was already done! Apparently Lazarus keeps tabs on such renames
and changes the places in the form code where the old name was used to
the new name! Excellent!! :-)
This is something I had wanted in Delphi too...

Now I am just wondering what other goodies are hidden in Lazarus?
Pleasant surprieses await, no doubt.

Question:
In Delphi I really wanted a feature of the VisualBasic 6 editor but it
never materialized in Delphi: Case correction.

This means that if I write a function like this:
function MyFunc: boolean;
var
  MyVar: byte;
  MyOtherVar: word;
begin
  myvar := 23;
  myothervar := myVar + 56;

then the editor will immediately correct the case of the variables so
the code comes out like this:

  MyVar:= 23;
  MyOtherVar := MyVar + 56;

And if I later change the declaration to:
  Myvar: byte;

then the places it is used will change to the new case style.

Is there some way one can make this happen in Lazarus?

(I made a quick test but it did not work right off the bat at least)


Bo Berglund





More information about the Lazarus mailing list