Welcome.
Let's take a look at how the continuous statement works, like the brake statements continue, a statement
also breaks the loop, but it won't end the loop.
It only ends the current step.
But the loop itself will continue from where it left off.
And I also show you how to use the integrated debugger inside the whiskered.
OK, let's get started.
This is a previous court, it's an artificial version of an actual four statements which are designed
for you to see how it works.
Now, let's say that I want to add only even numbers, the ones that are divisible by two, I can use
a continuous statement to do that.
Let's take a look first.
I'm going to type another if statement.
You'll see why in a second.
In this statement, I'll check for whether the airable is evil or not using the remainder operator.
If it's divisible by two, then that shouldn't be in the remainder.
So if there is a reminder, then it means that the number is an odd number, right?
This is exactly where I need to call the continuous statements.
So if the number is not an even number, I want the loop to stop now and continue for the next number.
OK, let me type continue now.
OK, what the statement does is that it skips the rest of the code after it and it goes back to the
beginning of the for loop, and that's all about it.
Let me show you.
They say that the program is on the line, OK, if the airable isn't an even number.
Then it's around the continue.
And when it does that, it will go back to the beginning of the loop like this.
And from there, it will run the next statement and so.
By the way, can you see a problem in this code now, please post the video and think about it.
All right, now, let me show you this program in South Dakota, Ed. I'll fix the error as well.
It is the same program.
Now, let me show you the problem by using the built in debugger.
First, I'm going to put a break point here at the beginning of the follow.
This breakpoint will allow the debugger to stop in here, you'll see.
Now, let me open the debugging panel from the left and start debugging.
By the way, if you have installed all the go tools, these debugger should work on your machine as
well.
Behind the scenes, these debugger uses a program called Dalle, if it doesn't work, uninstall your
editor and reinstall it again with the go tools, as I showed you before now.
Check out the variables on the left.
It shows them in real time.
Cool, right?
Now, the airable is one and the sum is zero.
OK, let's run this first statement.
I'm going to step into the fourth statement by clicking on this -- button here.
This click on the step into again to continue now it's on the second if, right?
This is where the problem happens.
Let's step into this.
Now it hits the continuous statement.
OK, let's continue.
Now, let's check the wearables again.
Here, the airable is still equal to one, right?
Let me continue running this a few more times, as you can see, it's been stuck here.
The variables never change.
Now, let's get back and fix this, OK?
The problem happens because this continuous statement here makes the loop endlessly continue without
increasing the airable.
I need to increase the airable here again like this.
This will fix the problem.
Michelle Reagan.
Now the airable changes its tune up.
OK, let's continue.
As you can see, this time, it escaped the second if and now it's on these line.
It's no longer a never ending loop.
OK, let me remove this breakpoints from here to.
OK, let's run this from the terminal now.
As you can see, it adds only the even numbers and the result is 30.
As you can see, you need to be careful with the continuous statements.
It may never end, especially in infinite loops like this.
As a bonus, we have learned how to debug your go kart as well.
OK, congrats, you learned to to use Loop's, you know, right, the cell phone to see in the next
picture of.