Watches

Overview

A Watch is a debugging feature used for examining the state of variables and other expressions within a running task. A watch can simply be the name of a variable. For example, to watch the value of a variable named TotalCount, add a watch that contains simply %TotalCount%. Embedded expressions can also be used within a watch, using the same syntax as a standard Automate Desktop embedded expression. For example, to watch the length of an Automate Desktop variable named myName, add a watch %Len(myName)%.

The Watches debug panel allows you to add, remove or modify items to watch. It displays the list of added watches and updates their value as the task runs. This way, watches can be re-evaluated after each task step is executed. Watches are mainly used for debugging, therefore, they are ignored when a task is executed as a result of a trigger or executed manually from the Task Administrator.

Using watches

The Watches debug panel is a place where you can enter variable names and expressions that you want to watch during a debugging session.

To watch a variable

  • Enter the variable to watch in one of the following ways:
    • In the Steps panel of the Task Builder, right-click the Create variable step associated with the variable you want to watch and select Add to WatchList.
    • In the Variables debug panel of the Task Builder, right-click the variable you want to watch and select Add to WatchList.
    • In the Watches debug panel, type the name of the variable in the provided text box and click Watch.

To watch an expression

  1. In the Watches debug panel, enter the expression to watch in one of the following ways:

    1. Type the expression into the text box. For example, to evaluate the length of an Automate Desktop variable named myName, enter Len(myName).

    2. Select the Expression Builder icon, located to the right of the Watches text box. When the Expression Builder dialog appears, use it to create an expression to watch. Click Insert when finished.

  2. Select Watch. The expression and its current value (if applicable) is added to the Watches debug panel.

To modify a watch

  1. In the Watches debug panel, right-click the desired watch and select Change.
  2. Enter the new variable or expression name for the watch, and then press Enter.

To remove a watch

  • Select the watch to be removed, and then press the Delete key.
  • Right-click on the desired watch, and then select Remove .
  • To remove all watches, right-click on any watch and select Remove All.
NOTE: Using watches can affect runtime performance in the debugger on slower machines. If debugging speed becomes a factor, try removing watches that are no longer needed. This does not apply to runtime performance outside the debugger, as watches are ignored when the task is executed outside Task Builder