Refactoring - Introducing Variables
Go Up to Refactoring Procedures Index
This topic explains how to use the "Introduce variable" operation.
To introduce a new variable:
- Select variable in the Editor.
- On the main menu, choose Refactor > Introduce Variable.
Tip: Alternatively, you can choose Refactor > Introduce Variable on the context menu.
- In the resulting dialog, specify the Name of the new variable. The new variable created is given the same type as the original variable.
- If desired, check Replace all occurrences. The Introduce Variable dialog indicates the number of occurrences that it will replace with the new variable.
Note: The refactoring does not replace any occurrences of the variable prior to the point in the code at which you selected to introduce the new variable.