DriveWorks Pro 15: Extract Variable [send feedback...]

Extract Variable

The Extract Variable function allows variables to be created directly from the Rule Builder.

Anything entered in the rule editor can be extracted to create a new variable.

Any occurrences of the selection can be searched for in every rule within the project, and be replaced with the new variable.

Extract Variable

To extract a portion of the rule you are currently building to a variable, in the rule builder:

  1. Select the portion of the rule to be converted into a variable.

  2. Right click anywhere in the rule editor window, to display the Context Menu.
  3. From the Context Menu select Extract Variable, to launch the Extract Variable dialog.

  4. Enter a name for the variable in the New variable name field and click OK.
    DriveWorks will check the name entered is valid.

    The field where the name is entered gives feedback on validity by remaining red when there is an error, and turning green when the name is acceptable.

    The OK button on the Extract variable dialog will be disabled until a valid name is entered.

    Causes of unacceptable variable names include:

    • Blank name.
    • Forbidden characters - (only alpha and numeric characters can be used for variables).
    • Variable name in use.

Replace in all Rules

This feature is not supported when editing document rules.

The Extract variable dialog has an option to Replace in all rules.

Selecting this option will replace all occurrences of the rule throughout the project.

The previous selection made for this option is maintained the next time Extract Variable is used.

Once OK is selected, and with the Replace in all rules option selected, a new dialog will open.

The Replace in all rules dialog will show all rules that will be changed.

There is an option for not changing a particular rule by deselecting the check box next to the required rule.

The Replace in all rules dialog displays the old rule - along with the portion that will be replaced highlighted. It also displays how the new rule will look with the created variable highlighted.

Once all replacements have been reviewed click OK to accept the changes and apply them into the project.

Click OK to close the rule builder.

Table of Contents