 This is Brian today. We'll be discussing more loops this time the for loop. So type dim I is integer And we're going to say for I equals one two ten and then console dot right line and we're going to write the I variable Notice how we did not declare this variable. Yes. I know I've kind of barked at you in the past You can actually go ahead and declare this Now we've set the value for it. I'm sorry. We have declared and now we're setting the value Right now for I equals one. So we're setting the value here to ten if we run that what's going to happen Let's find out one through ten You see that we have not incremented I we haven't done I plus equals whoops plus equals one Let's run that see what happens Two four six eight ten. So what's going on here as you can see is the for loop is automatically Incrementing it for us. So we don't need extra verbiage to do it. We can just rely on Dot net frameworks built-in functionality to increment that for us Once again, we'll run that so you can see exactly what's going on here One through ten or not incrementing it. It's doing it for us Pretty handy function. You can also enumerate objects Whoops get a little ahead of myself here dim s s string Equals and we'll just say hello and then dem see as care. Whoops Now a string is made up of characters each letter is a character And we're going to use a for each loop So for each character in the string and we are going to Write out that character Run your well, let's put another blank line in here so you can see what's going on Now you'll see both examples run at the same time Whoops, what did we do here? We made a boobo. You see our first one's working in our second one's not Did you spot the error? It's because I put the s instead of the C Yes, good old-fashioned debugging Now we get the desired result We're going one through ten and then we're printing out each character in the string Now why do you need the for loop? Couldn't you just use a do loop? Well, you could but the for loop is actually considered safer and It involves a lot less coding and less coding equals less bugs less problems to fix later on unless you're Horrible typer like I am in which case you're just always going to have bugs in your code But as you can see it's much more convenient to have the framework do the counting for you rather than you constantly Increasing a value yourself So that's the for loop and the for each loop now we'll be using the for each loop much more when we get into collections and lists and arrays which are other tutorials I Hope you found this one educational and entertaining and thank you for watching