Product Information > JADE Development Environment User’s Guide > Chapter 4 - Defining Methods, Properties, Constants, and Conditions > Promoting a Method Value to be a Local Method Constant

Promoting a Method Value to be a Local Method Constant

When editing a JADE method, you can promote a method string or numeric value to a local method constant.

To promote a method value to a method constant

  1. Click on a numeric or string value within the logic of the method.

  2. Select the Promote to Method Constant command from the Refactor submenu of the Edit menu.

    A dialog is then displayed, showing the selected value.

  3. In the Constant Name text box, specify the name that you require for the local method constant.

  4. Click the OK button.

The constant is then added to the constants section of the method (which is created if it does not exist) and all instances of the use of that constant in your method (but not in comments) are replaced by the specified name.

To undo the change or changes, press CTRL+Z to undo each change in that method.