Interact with Program using Immediate Window
Immediate Window lets you access objects and functions available in the suspended state of your program.
The window becomes available and starts accepting your input as soon as your program is suspended in a debugging session. You can see the window below the variables pane of the Debug window.
To show or hide the window, click the corresponding icon on the toolbar of the variables pane.
You can type any expression that reference anything available in the current context and then press Enter . You will see the result right below the expression and it will be added to the history of the executed lines for the current session. The result of the last evaluated expression is also shown in the
$result variable in the variables tab:
You can call any member functions on the available objects or any static functions available in the current context using any available objects as arguments — type the call and press Enter . The semicolon at the end of the call is optional.
Breakpoints on the execution path of the function will suspend the execution as if it were a normal call. The call will have its own part of the stack starting with Function Evaluation, which you can explore in the Frames panel:
When the call is complete, it will not change your current execution point even if it encounters an unhandled exception, but if the function changes any objects, the changes will apply to the current program state.
Create temporary variables
You can create temporary variables (also called synthetic variables) and use them to store values during the debugging session as well as to interact with other objects, as shown in the example below. Note that for assignment statements you must type semicolon at the end before you press Enter .
The example above also shows how the objects can be modified. Generally, you can assign any compatible values to the objects in scope and change their values using write-access methods.
Use other features
In the Immediate Window, you can press Up / Down to cycle through the executed lines (the history of the input is saved in the project settings), and use some of the familiar editor features: