
162Microsoft Visual Studio 2010: A Beginner’s Guide
The Locals and Autos windows can sometimes become crowded with too many variables and slow you down as your code gets more complex, especially when the variables you’re interested in are at the bottom of the list or so far apart that you must scroll between them. Another benefit of the Watch window is that you can drill down into an object to show a value without continuously expanding the tree view. An example of this is to type cust.Order.Total as shown in Figure
The Immediate Window
While debugging, it’s often useful to type an expression to see the results at the current time. The Immediate window allows you to type in variable names and many other types of statements. You can access the Immediate window by selecting Debug Windows, or it may open for you automatically during debugging at the
The Immediate window in Figure
When evaluating an expression in VB, prefix the statement with a question mark, ?.