Using Watches
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.
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
-
In the Watches debug panel, enter the expression to watch in one of the following ways:
-
Type the expression into the text box. For example, to evaluate the length of an Automate Desktop variable named myName, enter Len(myName).
-
Click the percent 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.
-
- Click Watch.The expression and its current value (if applicable) is added to the Watches debug panel.
To modify a watch
- In the Watches debug panel, right-click the desired watch and select Change.
- 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.