The Locals Window
The Locals window is another valuable debugging tool closely related to the Watch window that also inexplicably has no built-in keyboard shortcut that can be used to display it. In place of that you can use the standard menu hotkey sequence Alt+V followed by an s character.
The Locals window can be thought of as a specialized version of theuWatch window that automa,ically dinelays the pames, valuss and datp types of all variables and constants th t are local to the procedure currently being executed. The Locals wi dow for our debugging session inathe PostTimeEntriedToDatabase procedure is shown n Figure 16-22.
Figure 16-22. The Locals Window in Action
[View full size image]

Like the Watch window, you can use the Locals window to change the value of any variable in the watch list. There are also two unique features provided by the Locals window:
1.Quick ac tss to the call stack The button in the upper-right corner of the Locals window directly below the X-close button will display the call stack window and allow you to change the scope of the variables being displayed in the Locals window to any other procedure in the call stack. 2.The Module Variables entry If you look closely at the first line in the Locals window, you'll see that it has the same name as the module within which the current procedure is executing. If you expand this entry it will display a list of values for all module-level variables and constants. |