Rename

Top  Previous  Next

Renaming is a simple but powerful refactoring concept. If you ever find yourself puzzling over what a function does, or what its side effects are, then maybe it's time to rename the function. Same for variables, parameters, etc.

 

Rename works like this: select the name of a variable, parameter, Sub or Function by double-clicking it or selecting it with the mouse (you don't have to select it in the declaration - you can select any reference to the variable). Then click the Rename button. Rename will figure out what type of thing you're trying to rename, and then will change it and all references to it. This is substantially more reliable (and faster) than using the IDE's Find/Replace function, which only understands text, not syntax.

 

Rename currently can only rename locals, parameters and Private methods and variables, because renaming Publics would involve hunting down references throughout the current project, and, if applied to a public class in an ActiveX DLL, could cause problems in other referring projects. Some of these restrictions will be relaxed in the future, combined with warnings when appropriate.