Silverfrost Logo About Us | Contact Us
 

Examining variables

The simplest method for examining any of the current active variables is to use the variables window. This window presents a list of all variables that are accessible from the current scope. This list is sorted into scope order and then ascending alphabetical order. The variables window is made the current window by pressing F4.

If you want to examine a particular variable, you can do this by opening a data view window. Once opened, a data view window will remain open until the variable goes out of scope or you choose to close it. The contents of the window will be updated each time a break point (or single step action) is encountered.

The source window provides the user with four methods of examining the contents of a variable in a data view window.

  1. Press the right mouse button over a variable name in a declaration or executable statement.

  2. Move the cursor to a variable name in a declaration or executable statement and press Ctrl+P.

  3. Mark a block over an expression and either press the right mouse button over the block or press Ctrl+P (this allows the expression to be displayed).

  4. Use the 'print' command from the command line (this allows complete freedom in the choice of data shown).

Methods 1 and 2 provide a very quick way to access simple variables. Methods 3 and 4 can be used to access more complex information like the current array element in a loop. Method 3 has the disadvantage that the expression must be present in the source code. Using the command line (method 4) allows greater flexibility.

To mark a block you can either drag the mouse pointer over the text whilst keeping the left hand mouse button depressed. Alternatively, you can use the arrow keys with the shift key held down. The block is shown as blue text on a cyan background. Pressing an arrow key without holding down the shift key will cancel the block mark.

In addition to the above methods for examining variables, the Win32 debugger provides 'tooltips' which appear when the mouse cursor passes over a variable in the source window. This tooltip takes the form of a small volatile window containing the value of the given variable.

 

 

Copyright © 1999-2017 Silverfrost Limited