Introduce Variable

From RAD Studio
Jump to: navigation, search

Go Up to Refactor Menu

Refactor > Introduce Variable

Note: This feature comes through Visual Assist.

The Introduce Variable feature defines a temporary variable in the innermost scope of the selection. It initializes it with the replaces code, if any, and replaces one or multiple occurrences of the expression with the temporary variable.

VA Intro variable.png

To perform this feature, follow the next steps:

  1. Set the cursor in the symbol.
  2. Go to the Refactor option of the main menu.
  3. Select Introduce Variable.
  4. When the Introduce Variable window opens, enter the variable signature in the text field.
  5. Click OK to introduce the variable or Cancel to exit the feature.

See Also