1318 Visual Studio .NET Debugger Appendix D A programmer can evaluate expressions line-by-line in the Immediate window (Fig. D.9). To evaluate an expression, a programmer types this expression into the window and presses Enter. For example, when a programmer enters Console.WriteLine(i) and presses Enter, the value of i is output to the console window. A developer also can use the assignment operator (=) to perform assignments in the Immediate window. Notice that the values for i and xin the Locals window contain these updated values. Testing and Debugging Tip D.4 Use the Immediate window to call a method one time. Placing a method call inside the Watch window calls that method every time the program breaks. D.4 Program Control The Visual Studio .NET Debugger give programmers considerable control over the execution of a program. Using breakpoints and program-control commands provided by the debugger, programmers conveniently can analyze the execution of code at any point in a program. This is useful when a program contains multiple calls to methods that are known to execute properly. The Debug toolbar contains buttons that provide convenient access for controlling the debugging process (Fig. D.10). To display the Debug toolbar, select View > Toolbars > Debug. The debug toolbar in Fig. D.10 controls debugger execution. The Restart button executes the program from the beginning, pausing at the beginning of the program to allow the programmer to set breakpoints before the program executes again. The Continue button resumes execution of a suspended program. The Stop Debugging button ends the debugging session, and the Break All button allows the programmer to suspend an executing program directly (i.e., without explicitly setting breakpoints). After execution suspends, the yellow arrow appears indicating the next statement to be executed. Testing and Debugging Tip D.5 When a program is executing, problems such as infinite loops usually can be interrupted by selecting Debug > Break All or by clicking the corresponding button on the toolbar. Clicking the Show Next Statement button places the cursor on the same line as the yellow arrow. This command is useful when a programmer needs to return to the current execution point after setting breakpoints in a program that contains many lines of code. The Step Over button executes the next executable statement and advances the yellow arrow to the following line. If the next line of code contains a method call, the method is executed in its entirety as one step. This button allows the user to execute the program one line at a time without seeing the details of every method that is called. This is useful when a program contains multiple calls to methods that are known to execute properly. We discuss the Step Into and Step Out buttons in the next section. The Hex button toggles the display format of data. If enabled, Hex displays data in hexadecimal (base 16) format, rather than displaying data in decimal (base 10) format. Experienced programmers often prefer to read values in hexadecimal format especially large numbers because hexadecimal number representation is more concise and can be converted easily to binary (base 2) form. For more information about the hexadecimal and decimal number formats, see Appendix B, Number Systems.
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.