Recent

Author Topic: Disable the auto Variable-name update  (Read 8433 times)

HatForCat

  • Sr. Member
  • ****
  • Posts: 293
Disable the auto Variable-name update
« on: February 16, 2017, 06:59:43 pm »
Hi, I have  a TEdit named "edCheck" and I want to change the name in the IDE but do not want that change to ripple through the entire source as it currently does.

Is there some way to temporarily disable the auto-renaming in the entire Source file? Sometimes I just want to rename that single TEdit to "edCheckX" (or whatever) so it will toss a Compile fault and jump straight to it in the source.

I know I can use "Find," but that needs some extra work and old habits die hard.

Acer-i5, 2.6GHz, 6GB, 500GB-SSD, Mint-19.3, Cinnamon Desktop, Lazarus 2.0.6, SQLite3

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Disable the auto Variable-name update
« Reply #1 on: February 16, 2017, 07:24:21 pm »
If you press F2, and uncheck "Rename" the Search Results dialog will list all occurrences of edCheck, and you can jump directly to whichever one you want by clicking on it.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Disable the auto Variable-name update
« Reply #2 on: February 16, 2017, 07:39:55 pm »
You can edit the lfm.

Either in the IDE (right click form, show lfm), or outside the IDE, while the IDE is closed.

Instead of just "Find" use "Find Identifier references" (context menu)

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Disable the auto Variable-name update
« Reply #3 on: February 16, 2017, 10:18:09 pm »
Hi, I have  a TEdit named "edCheck" and I want to change the name in the IDE but do not want that change to ripple through the entire source as it currently does.

Why would you not want that?
This way you rename the control only in lfm, not in sourcecode.
This wil lead to disaster.

Bart

HatForCat

  • Sr. Member
  • ****
  • Posts: 293
Re: Disable the auto Variable-name update
« Reply #4 on: February 17, 2017, 04:16:20 pm »
Why would you not want that?
This way you rename the control only in lfm, not in sourcecode.
This wil lead to disaster.

Please read my original post. I want "disaster" as I want to quickly find all occurrences of that Control. It is a debugging technique used often by Professionals. :)

You rename the Actual Edit to "edCheckX" then hit F9.
The compiler will break and take you right to the first use of that Edit. If that is not the instance of the edit you are after then you also add the "X" to the end and hit F9 again. Simple and quick. Way faster than using Find.

When you have found and fixed the issue just leave them all with the "X" on the end.
Acer-i5, 2.6GHz, 6GB, 500GB-SSD, Mint-19.3, Cinnamon Desktop, Lazarus 2.0.6, SQLite3

HatForCat

  • Sr. Member
  • ****
  • Posts: 293
Re: Disable the auto Variable-name update
« Reply #5 on: February 17, 2017, 04:19:36 pm »
If you press F2, and uncheck "Rename"

Thanks, I just tried that but all I get is a Name Change box, "Choose a name for this component."

Could the Linux version be a little different?
Acer-i5, 2.6GHz, 6GB, 500GB-SSD, Mint-19.3, Cinnamon Desktop, Lazarus 2.0.6, SQLite3

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Disable the auto Variable-name update
« Reply #6 on: February 17, 2017, 04:37:51 pm »
Please read my original post. I want "disaster" as I want to quickly find all occurrences of that Control. It is a debugging technique used often by Professionals. :)

I'll leave it to the professional then  O:-)

Bart

Thaddy

  • Hero Member
  • *****
  • Posts: 14204
  • Probably until I exterminate Putin.
Re: Disable the auto Variable-name update
« Reply #7 on: February 17, 2017, 04:45:05 pm »
Please read my original post. I want "disaster" as I want to quickly find all occurrences of that Control. It is a debugging technique used often by Professionals. :)

I'll leave it to the professional then  O:-)

Which ones? Name names.... Horrible......
I may add I would fire them for wasting time....  >:(  on "alternative facts".
I would probably hire Bart instead, but he is happy in a completely different line of business.

Or are you referring to the old television series?  O:-) (Probably, the way it is spelled.)
« Last Edit: February 17, 2017, 04:49:21 pm by Thaddy »
Specialize a type, not a var.

HatForCat

  • Sr. Member
  • ****
  • Posts: 293
Re: Disable the auto Variable-name update
« Reply #8 on: February 17, 2017, 08:58:01 pm »
{sigh} and off the rails we go again.

Why is it so hard to get an answer to the actual question being asked?

To wit...
"Is there some way to temporarily disable the auto-renaming in the entire Source file?"

It really does not matter why I want to do that, just answer the question if you know how to help.

As a Help forum this is more a chest-thumper's convention.

I have started and sold several very successful programming businesses, hired and fired dozens of so-so programmers. Now that I am retired I am messing with stuff I never had the time to do. Moving to Linux for instance and all that it entails. Giving up Delphi for another thing. Taking up Lazarus and it's somewhat autocratic insistences and weirdness. Main edit window jumping around every time I swap workplaces and return.

It's all good entertainment, but some of the things are so radically different to what I am used to, I have to resort to asking here. Rest assured, it is only with desperation after not finding results on AskUbuntu, Stack-Overflow etc that I come here.

I suspect I am not alone. Maybe check the new Registrations over the past 12-months then compare the number of times those people return or better, even stay. My guess is they leave quickly, very much the same as the Ubuntu and Arduino forums, a huge turnover  largely as a result of no-help-comments as the above, instead of actual Help.

Sad to see. But, there are still a few very good, willing and generous helpers here, so I will attempt to tough it out through the White Noise. :)
Acer-i5, 2.6GHz, 6GB, 500GB-SSD, Mint-19.3, Cinnamon Desktop, Lazarus 2.0.6, SQLite3

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
Re: Disable the auto Variable-name update
« Reply #9 on: February 17, 2017, 09:08:35 pm »
Don't worry about Thaddy and Bart. They have a special way of communicating, but they are knowledgeable and caring, and mean well, honest! ;D

I understand that you want to check what's using a particular thing by renaming it.
Auto-rename would defeat that approach.
I agree.
And that approach seems to be quick, dirty and faster than looking it up in a graph/tree.

I would love to give you a straight answer, but I do not know the answer. My opinion is that it should be possible to bypass that particular IDE magic trick in certain situations.
« Last Edit: February 17, 2017, 09:14:22 pm by jacmoe »
more signal - less noise

FTurtle

  • Sr. Member
  • ****
  • Posts: 292
Re: Disable the auto Variable-name update
« Reply #10 on: February 17, 2017, 10:02:05 pm »
1. Rename variable in class declaration, for example:

Code: Pascal  [Select][+][-]
  1.   TForm1 = class(TForm)
  2.     Button1: TButton;
  3.     Button2: TButton;
  4.     Edit1: TEdit;                // rename to Edit123
  5.     procedure Button1Click(Sender: TObject);
  6.     procedure Button2Click(Sender: TObject);
  7.   private
  8.     { private declarations }
  9.   public
  10.     { public declarations }
  11.   end;

2. Press F9 and fix in cycle...

3. After compilation is succesful, change name in object inspector and recompile.
« Last Edit: February 17, 2017, 10:07:06 pm by FTurtle »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Disable the auto Variable-name update
« Reply #11 on: February 17, 2017, 10:38:48 pm »
{sigh} and off the rails we go again.

Why is it so hard to get an answer to the actual question being asked?

To wit...
"Is there some way to temporarily disable the auto-renaming in the entire Source file?"

You did get it:

Edit the lfm (can be done in the IDE or outside).

The other part of the answer is, if you use the ObjectInspector (or any part of the form editor) then it will always rename all instances.

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Disable the auto Variable-name update
« Reply #12 on: February 17, 2017, 11:08:41 pm »
Don't worry about ... and Bart. They have a special way of communicating

I feel a little bit offended by that.

Bart

jacmoe

  • Full Member
  • ***
  • Posts: 249
    • Jacmoe's Cyber SoapBox
Re: Disable the auto Variable-name update
« Reply #13 on: February 17, 2017, 11:29:48 pm »
I feel a little bit offended by that.
What I am seeing is, after HatForCat has answered your question about why anyone would want to do that, this response:

I'll leave it to the professional then  O:-)

That's sarcasm. Uncalled for, IMO.
That's why I explained to HatForCat that he shouldn't take you (and Thaddy) too seriously.
more signal - less noise

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Disable the auto Variable-name update
« Reply #14 on: February 17, 2017, 11:37:58 pm »
That's sarcasm. Uncalled for, IMO.

It wasn't meant to be sarcastic.
Anyhow I'll stop now.

Bart

 

TinyPortal © 2005-2018