Welcome to MSDN Blogs Sign in | Join | Help

Sara Ford's Weblog

My adventures embracing open source on CodePlex and at Microsoft

News

    • Did you know... All author proceeds go directly to sending Hurricane Katrina survivors to college.

      Microsoft Visual Studio Tips book

      Recent Entries

Did you know… You can press Shift+F11 to step out of a function - #311

“All mixed up you don't know what to do… Next thing you turn around and find the person is you…” with apologies to the band 311.

I recall learning Step Out once I got to the Visual Studio team. Again, it was a glorious moment.

Suppose you are within a function and want to get out of it because you’re in it by accident or you’re just tired of being in it.

within method Speak()

You can press Shift+F11 from anywhere in the function to jump out of it and back to the caller.

back to the caller of method Speak() 

Now the thing i don’t get is how do you know whether this next statement in the above picture is about to execute or has been executed. maybe there’s a visual glyph somewhere that i’m missing…

Technorati Tags: ,
Posted: Thursday, September 11, 2008 3:00 AM by saraford

Comments

Raj said:

Sara,

Is it possible to set a property to "remain in the same class" while debugging?

Thanks.

Raj

# September 11, 2008 5:21 PM

Tess said:

Sara,

    The statement you made:

Now the thing i don’t get is how do you know whether this next statement in the above picture is about to execute or has been executed. maybe there’s a visual glyph somewhere that i’m missing…

To answer your question, I know for sure in VB, when an application is in break mode, the Step into command causes the currently highlighted line (the execution point) to execute.  If that line contains a call to a procedure or function (method), the next highlighted line is the 1st line in that procedure or function (method).  In other words, the Step Into command allows you to single-step through a procedure or function (method) when it is called.

    Like the Step Into command the Step Over command causes the currently highlighted line to execute.  If the line contains a procedure or function (method) call, however, the procedure or function (method) is executed without stepping through its statements.

    Finally, use the Step Out command when single-stepping through a procedure or function (method), if you want the remainder of the procedure or function (method) to complete execution without single stepping.  After the procedure or function (method) has completed, the line following the procedure or function (method) call is highlighted, and you may resume single-stepping.

    Logic tells me since the languages you can program in Visual Studio all use the .NET Framework it does not matter if you are coding in C++, VB, Java, ect... the same above would apply to any and all languages written in Visual Studio and Express Editions with the exception of obviously syntax and possibly when using the Visual Web Developer I believe somethings in the debugger mode are different there.  Do not mark my word about that though, (anyone feel free to correct me if I am wrong) it has been a good year or so since I have used the Visual Web Developer and I do not remember on the top of my head if is a similar debugging environment.  I am sure it is though.  One thing I do remember in Web Developer is that you have to add the Web.config file (containing an option that permits debugging)to your project when you debug for the 1st time.

NOTE: The word method means the same thing as a function or procedure.  Method is the terminolgy used by OOP programmers, incase anyone needs clarification about that.

In VB:

Step Into F8

Step Over Shift + F8

Step Out Ctrl + Shift + F8

# September 15, 2008 1:07 PM

Visual Studio Hacks said:

The lack of posts over the past week was due to the hurricane (Ike) damage and my subsequent lack of internet service (as well as power, water, gasoline, and many other important things). That stuff is back for me now, but the last report I saw stated

# September 21, 2008 7:08 PM

xjb said:

# March 2, 2009 8:17 PM
New Comments to this post are disabled
Page view tracker