Partager via


Variables Window (Compact 2013)

3/26/2014

The Variables window provides quick access to variables that are important to the program's current context. To display this window, go to Debug > Windows > Autos.

The following tabs appear in the Variables window.

  • Auto
    Displays information about variables from various statements of interest. These statements can include the current statement and other statements related to the current statement. Variables appear in alphabetical order. If a statement spans multiple lines, the Auto tab displays variables from the lines corresponding to that statement, up to a 10-line limit.
  • Locals
    Displays the names, values, and types of all local variables in the current function. As you trace through a program, new variables come into scope.
  • this
    Displays the type, name, and value information about the object that is pointed to by the pointer this. All base classes of the object are automatically expanded.

Each tab contains a table with fields for the variable name and value. The debugger fills in these fields.

  • If a value appears in red, the value has recently changed. Only the last value to change appears in red.
  • You can right-click any tab to bring up a shortcut menu of commands.
  • You can cut, copy, or drag information from the Variables window. You can edit the Value column to change the value of a variable while debugging.
    If you selected hexadecimal display, enter the value in hexadecimal or use the prefix 0n (zero-n) to indicate that the number is a decimal, such as 0n1000.
  • You cannot add variables or expressions to the Variables window, but you can change the value of an existing variable by double-clicking the associated Value field and entering new data.
  • You can also expand or collapse the list of displayed variables by using the tree controls.

You can expand an array, an object, or a structure variable in the Variables window if the variable has a plus (+) box next to it in the Name list. If an array, object, or structure variable has a minus (-) box next to it in the Name list, the variable is fully expanded.

  • If the variable is an object, a reference, or a C++ pointer to an object, the Variables window expands the variable to show the most important data at the top level.
  • If the variable is a reference or a C++ pointer to an object, the Variables window downcasts the reference or pointer.
    The Variables window adds an extra member to the expanded object. This extra member, which looks like another base class, indicates the derived subclass.
    For example, if a variable declared as a C++ pointer to CObject points to a CComboBox, the Variables window recognizes this and adds an extra member so you can access the CComboBox members.

Variables Window Context Box

In addition to tabs, the Variables window has a context box on the toolbar that contains a copy of the current call stack in a drop-down list box. Use this list to specify the current scope of variables that are displayed.

You can navigate to a function's source code or disassembled object code from the Context list. This procedure displays the function's source code, if available, in a source window. If source code for the selected function is not available, this procedure displays the function's object code in the Disassembly window.

To autosize a column to fit its contents, double-click the vertical divider at the column edge. To size a column manually, drag the right divider to the left or right.

Rows are sized to fit the current font and cannot be resized manually.

Shortcut Menu Options

Right-click the window to bring up a menu, which contains the following functions:

  • Copy
    Copies the selected text.
  • Copy Expression
    Copies the selected expression.
  • Copy Value
    Copies the selected value.
  • Hexadecimal Display
    Changes the way integers are displayed:
    Turn this option on to display all integers, both signed and unsigned, in hexadecimal.
    Turn this option off to display all integers in decimal.
  • Automatically Expand Expression
    Displays the expanded value or expression of the selected variable name.

See Also

Concepts

Platform Builder User Interface

Other Resources

Platform Builder Windows