Did you know… What’s the difference between the Autos window and the Locals window? – #316

I’ve always wondered this, but finally took the time to ask Dustin Campbell when I met with him last week for Debugger tips.

The autos window shows the current statement and the previous statement.  it was always the previous statement that threw me off, as i never took the time to look closely enough to realize that’s where that variable was coming from.

The locals window shows everything currently in scope. Thus, the autos window is a subset of the locals window.

For example, consider the following code snippet that does nothing but produce warnings for unused variables:

Code snippet showing some variables

In the Auto windows, you’ll see the previous statement and the current statement being evaluated:

Auto windows showing previous and next statements

In the Locals window, you’ll see the everything in scope, including the args parameter:

Locals window showing everything in scope

Technorati Tags: VS2005Tip,VS2008Tip

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>