Visual Basic Fundamentals for Absolute Beginners: (08) Operators, Expressions and…

Iterations allow our applications to loop through a block of code until a condition is satisfied. We'll cover several different types of iteration statements throughout this series, but we'll start with the for iteration statement. I'll demonstrate how to utilize "code snippets" to help remind you of the syntax for this complex statement, and will demonstrate debugging in action as we watch the values of our loops displayed in the Visual Studio IDE in several ways.
Full course outline:
What's the difference between the use of the For..Next and Loop..Until statements?
@Shadolio: For Next is traditionally used when you want to go through a loop a specific number of times. You could accomplish the same thing in a Loop, but you'd have to declare the index variable and you'd have to increment it yourself. It does allow you some more flexibility (you could increment by 2 if a certain condition was met for example), but it also opens the door to an infinite loop if you forget to increment the counter or write your logic incorrectly. If you have a fixed number of loop iterations in mind, I'd use a For ... Next, if you want to loop until you find something or for a variable amount of time, then a Do Until ... Loop may be a better choice. Just make sure you always have a way out (if you hit the end of the file, or have been looping more than x times without hitting your expected condition, etc.)
hello seems this note with tab tab is enable by configuration i dont have it
Hi! I was just wondering, in the second example where you write this code:
For x = 10 To 5 Step -1
Console.WriteLine(x)
Next
How come x doesnt have to be declared first? Is x not a variable here? Sorry, just a little confused!