User`s manual

98 digi.com Debugging with Dynamic C
6.3.5 Evaluate Expressions
The evaluate expression functionality was separated out from watch expressions in Dynamic C 8.01. It is a
special case of a watch expression evaluation in that the evaluation takes place once, when the Evaluate but-
ton is clicked, not every time the Watches window is updated.
Pros Like watches, you can use the Evaluate Expression feature on any valid C ex-
pression. Multiple Evaluate Expression dialogs can be opened simultaneously.
Cons Can alter program data adversely if the change being made is not thought out
properly
Uses This feature can be used to quickly and easily explore a variant of program flow.
Example Say you have an application that is supposed to treat the 100th iteration of a loop
as a special case, but it does not. You do not want to set a breakpoint on the loop-
ing statement and hit F9 that many times, so instead you force the loop variable
to equal 99 using the evaluate expression dialog. To do this compile the program
without running it. Set a breakpoint at the start of the loop and then single step
to get past the loop variable initialization. Open the Inspect menu and choose
Evaluate Expression. Type in “j=99” and click on the Evaluate button. Now you
are ready to start examining the program’s behavior.