Watches are one-line dynamic instruments that watch and report upon values of variables in scripts or other process parameters. They are used to debug scripts by signaling watched-for conditions.
The Watches pane is enabled when the Manifold Debugger is installed.
Watches are user-defined expressions that dynamically report on the behavior of a variable or expression. Watch expressions may be a variable, a property, a function call or any valid expression (using arithmetic, for example) within the scripting language in use.
Watches are automatically updated during debugger commands. They will display the value of an expression within a given context and are a great way of monitoring what's going on in the script. In earlier days, one would have to insert short printing statements to print out different expressions as the code executed. In modern times, we can just use a watch to report those values "on the fly" within the Watches pane.
|
|
New Watch - Create a new watch. Double-clicking onto the next blank line in the Watches pane is a shortcut for creating a new watch. Double-clicking onto an existing watch is a shortcut for editing it. |
|
|
Delete Watch - Deletes the highlighted watch from the pane. Highlighting a watch and pressing the Delete key will delete it. |
|
|
Show Type - Press in to show the type of the variable. |
|
|
Show Common Properties - Press in to show the Application and Parent properties that are common to all Manifold objects. Also controls the display of the Item and _NewEnum properties normally found in collections. |
Double-clicking a watch or highlighting it and pressing the F2 key will edit its value.
Example
Suppose we've stopped execution in a script called A at a breakpoint where another script is run.

We've added two new watches to the pane. One watch was created using the expression "components" and the other was created using the expression "components.Count + 1".
With both Show buttons pressed in, the Watches pane will report the following values:

The components watch has been expanded. We could furrther expand the hierarchy to see the Application and Parent properties, to expand those properties and so on. We can see that the Count property for the components object has a value of 2.
The components.Count + 1 expression evaluates to a value of 3.
See Also
See the Debugger topic for an example of using the Watches pane. Other panes used with the debugger include: