User forums > Using Code::Blocks
Feature : dynamically rename a variable
sleli:
Hello,
It should be nice I may use this feature because I have to apply coding standards upon variables, functions etc...
What I would like : Select a variable named "layer_id" and renamed it "AGS_LayerId" for example everywhere in my code. If it's a local variable, renamed it only into the appropriate function.
Is there anyway to do that efficiency with Code::Blocks ?
Thanks
Have a nice day.
Stephane
rcoll:
Did you try the "Replace in Files" function under the "Search" menu?
Ringo
thomas:
Interesting idea, something I'd wish to have too sometimes. Unluckily the "only inside a function" thing means that there would have to be some considerable AS built into Code::Blocks, which currently isn't the case.
So... yes, "replace in files" sure works, but it's not precisely what you want.
Jan van den Borst:
Yes this would be very nice to have. In MS visual studio C# it can be done with refactor-->rename. The MS ide knows which vars to change and which not. Not an easy thing to implement (robustly)
Jan
rcoll:
--- Quote from: thomas on September 12, 2008, 12:01:53 pm ---Interesting idea, something I'd wish to have too sometimes. Unluckily the "only inside a function" thing means that there would have to be some considerable AS built into Code::Blocks, which currently isn't the case.
So... yes, "replace in files" sure works, but it's not precisely what you want.
--- End quote ---
I don't get this ... what is it exactly you would like to do? If I want to change "MyVar" to "SomeOtherVar", then replace-in-files works perfectly fine for me. If it's a really *really* complicated search-and-replace, I just load up an external editor that specializes in such things and do it there. It's such a rare thing, I don't really mind doing it.
What am I not understanding?
Ringo
Navigation
[0] Message Index
[#] Next page
Go to full version