Aug 12, 2011 08:44 AM
(This post was last modified: Aug 12, 2011 08:45 AM by eXero.)
Understanding the 'Do' Loop
I have seen many members confused on how to use loops. Loops should be the first thing you should learn about any programming language as loops are important in every language. I am writing this tutorial explaining the Do Loop. Look for my other tutorials on the other loops.
Step One
Open a new Visual Basic Project. Select Console Application, and name it whatever you want. I named mine "Basic Do Loop".
Spoiler (Click to View)
Step Two
You should have a screen now that shows this code:
Spoiler (Click to View)
Don't worry about all of that. We are only going to work in Sub Main for the time being.
Step Three
This is the Do Loop code itself:
Spoiler (Click to View)
Code
Dim i As IntegerCode
Do While i < 10
Console.WriteLine(i)
Console.ReadLine()
i = i + 1
LoopCode
Dim i As IntegerCode
Do While i < 10Code
Console.WriteLine(i)Code
Console.ReadLine()Code
i = i + 1Code
LoopStep Four
Voila! You have successfully written, and hopefully understood your Basic Do Loop program.
Step Five
Post a reply with what you thought of this tutorial, how well you understood, etcetra. It only takes ten seconds, and I really would love your feedback.




![[Image: vjPWhyy.gif]](https://i.imgur.com/vjPWhyy.gif)
![[Image: 8SQ8H.png]](https://puu.sh/8SQ8H.png)