Create a New Expression from within the Data View
You can add a new expression to the Data View in multiple ways:
*Dragging and dropping an existing expression to the row [Add a new Expression].
Here, the int i is added, resulting in two copies in the Data View.
*Using the Dive in New Data View or Duplicate features, available from the context menu.
Right-click on an expression in the Data View and select Dive in New Data View or Duplicate. See Dive in New Data View or Duplicating an Expression.
*Entering a new expression manually. See Entering a New Expression into the Data View.
Entering a New Expression into the Data View
Because variables are actually expressions— in fact, lvalues that evaluate to a memory location— you can enter an expression into the Name field to troubleshoot data problems.
To add a new expression, double-click on Add New Expression in the Data View and begin typing.
Some examples:
*View just a sub-element of a structure, by entering it as a new expression:
A new expression is added. This is the same as diving on the sub-element.
*Increment a variable:
*Add or subtract variables, assuming some relationship:
*Add a global variable. Type the variable name into the Name column and TotalView automatically enters the type and value.
The value updates in the Data View as you run through your program.
Operating on Multiple Expressions
You can select multiple expressions to perform an operation on, such as to duplicate, dive, or delete. Hold down the Ctrl key and select the expressions, then right-click for the context menu.
Duplicating an Expression
Choosing Duplicate from the context menu makes a copy of the variable and places it at the bottom of the existing Data View. You can duplicate any variable, including a single scalar variable, an entire complex variable, or a subelement of a complex variable.
If the duplicated expression had been “dived on,” the dive stack is also duplicated. See Diving on Variables.
Deleting an Expression
Delete an expression using the context menu and selecting Delete or by clicking Delete on your keyboard.
NOTE: For complex variables, deleting a single element deletes the top-level variable from the Data View. You cannot delete a single element of a structure or an array.