In This Book

Using Command Buttons

There are two command buttons that allow you to display values of variables. The values are printed in the debugger output area. The following buttons are located below the source ￿le display area:

4

Print()

5

Print the value of the contents of the ( ): input box.

 

 

 

 

 

You can also evaluate expressions and assign values to

 

 

 

 

 

expressions. For example, in C syntax, if n/2 is in the input

 

 

 

 

 

box, the result of n divided by 2 is printed. If n = 4 is in the

4

 

 

 

 

input box, the value 4 is assigned to the variable n.

 

 

 

 

 

 

 

 

 

If the expression, ptr, is a pointer, printing ptr displays the

 

 

 

 

 

address of the variable pointed to. Printing *ptr displays the

 

 

 

 

 

value pointed to.

 

4

 

5

Print the value pointed to by the pointer in the ( ): input

 

Print*()

 

 

 

 

 

box.

 

For example, if ptr (declared as int *ptr;) is in the input box, the integer pointed to by ptr is displayed.

You can double-click or highlight the variable name or expression in the program source to copy it to the ( ): input box.

If the current location points to the procedure containing the variable, you can use the name of the variable without any quali￿ers. If not, specify it according to the rules de￿ned in \Using Quali￿ed Names" in Chapter 7.

Using the Mouse

Another metho d for examining variables and expressions is to use the mouse as follows:

1.Position the cursor o ver an expression in the source ￿le displa y area.

2.Click the right mouse button. The Source Actions popup menu appears.

3.Select either Print or Print* . Note that the expression under the cursor appears as an argumen t to these commands.

Viewing and Manipulating Target Program Data 4-3