[MUSIC]
>> I like it. Okay.
One of the thing that I would love to do, especially,
for somebody who's new to the debugger,
is I would love to spend just a couple of minutes on the basics.
>> Yeah.
>> I'm going to make one real quick assumption
and actually, you know what,
I'm not going to, I shouldn't do this.
Let's start here.
Let me ask this very basic question and then we can branch out.
What's a breakpoint?
>> Yeah. A breakpoint,
it's this little red icon here that we started at the beginning.
Basically, what it lets you do is you can pick
a line of code that you would like to inspect first.
Then from there, if you hit "Run" or
"F5" or whatever the equivalent
is on whatever ID that you're using.
Breakpoints are pretty equivalent across most of the major ones.
Then your code will stop its execution at that given point.
Then from there you can choose to
go line by line and inspect whatever you want
or you can choose to stay at that line and use
whatever tools that you want in
order to try to identify your problem.
Let me refresh, and I can go ahead and hit
that "Breakpoint" that I had set there, again.
That's the gist of it.
>> Okay. That makes sense.
>> Yeah. It's like a stop, it's telling your code
stop at this given point and let the user decide
where they want to go from there.
>> Right. Let me go take a look then at what the current status.
Let me explore a little bit.
>> That's fun. Got a lot of errors.
>> Absolutely. Give that one more second.
>> Yeah.
>> There we go. I have hoped.
>> I have hoped too. That's a good sign that
didn't happen before the pop-up.
But what's great about breakpoints is that
once you get the basics down,
there's so many different kinds of breakpoints
that you can use to take it a step further.
Like if you wanted to stop under
a given condition then you can do that, which is pretty sweet.
>> [inaudible]
>> Okay. Here we go.
>> Here we go.
>> Yeah. So unsteady.
You know that your breakpoint has been hit and
a lot of IDs, you'll get like a little arrow like this,
it might be hard to see
but there's this yellow execution arrow here.
This is the arrow that is letting you know
which line is about to be executed next.
As I mentioned from here, my code is completely stopped.
It's not doing anything besides existing at this given line.
If I wanted to continue,
then I have a couple of options.
The first one I can use is the Step Over tool.
Step Over just lets me go to the
next line that's about to be executed.
In this case, it's the stream reader block here.
Then from there I can choose Step Over again and go inside here.
There are cases where you may want to step inside another method.
If you do that, then you can use Step Into.
That's probably not going to work here because
I have a setting that allows me to just ignore code
that's not mine because [inaudible] turned it on.
I don't really care about that.
But I believe get this string for images,
one that I own, so if I stepped into that then
it should take me to that method.
>> Okay.
>> That's Step Into. Then let's say,
I can step into there and I could do this all day,
could go on forever depending on what your code is doing.
But if I wanted to step out of
this method and return back to that line,
then that's where Step Out can come into play and
return me back to that line I was previously at.
>> Okay.
>> That's the basics.
So setting brace is at breakpoints.
You can set more than one, if you want.
You can have 50 if you want.
Also, the beauty about Visual Studio is that you can
keep track of all your breakpoints
in the breakpoints window down here.
If you do want to get breakpoint happy,
just know that it's pretty easy
to discover and deal with them as you want.
Also, the part about using multiple breakpoints,
if that's something you want to do,
in addition to something like Run to Click,
is you can set a breakpoint,
let's say, at the end of this function,
and then we'll hit "Continue" and
it should take me to that next breakpoint.
It'll go ahead and run everything else
from that previous line that I was at up to that point.
>> Okay. That's a lot like that runs a cursor,
only this time it's instead going to the next breakpoint.
>> Yeah. Personally, I like to use Run to Click,
if I don't intend to use a specific
breakpoint for a very long time.
Like if I wanted to just be
onetime thing, I'm going to use Run to Click.
But if I intend to make a jump like this a lot of times,
then might as well set a breakpoint, but it's your call.
>> Okay.
>> Whatever floats your boat.