<type>documentation</type>
<domain>debug</domain>
<id>evaluating-expressions</id>
<title>Evaluating Expressions</title>
<date>$Date$</date>
<version>$Revision$</version>
<product>pro+</product>

The `Watch <script:show_panel#panel_type="debug-watch">`__ tool can also be used to view
the value of arbitrary expressions in the context of the current debug stack frame. These
may be entered by clicking on any cell in the ``Watch`` tool's tree and editing or
entering the desired expression in the ``Variable`` column. Press ``Enter`` to complete
the edit.

Since expressions are evaluated in the context of the current debug stack frame, this
feature is available only if there is a paused debug process.  For the same reason,
the value of expressions may change as you move up and down the stack.

Some caution is required to avoid undesired side-effects in the debug process. In cases
where evaluating an expression results in changing the value of local or global variables,
your debug process will continue in that changed context and the updated values will be
shown in Wing's debugger tools.

Only expressions that evaluate to a value may be entered. Other statements, like variable
assignments and import statements are rejected with an error.  Exceptions that occur
during evaluation or an expression are not shown, and breakpoints are not reached.  
To execute other statement types or to debug problems with an expression, use the 
`Debug Console`__.

__ ref:debug/debug-console
