You may have to perform some task when a condition is true and repeat this until the condition is false. Conversely, you may have to perform a task several times for a condition that is false until it becomes true. This is done using loops. Before I even begin to discuss loops, I will bring up the magic instruction. This, by the way, is one of the most common problems in programs.
Loops use two sets of commands.
These are the Do Loop and For Next combinations. The Do Loop command uses the following syntax. Loop You would use the combination of Do While when you are starting with a condition that is true and you wish to continue until it is false. You would use the combination of Do Until when you are starting with a condition that is false and wish to repeat until the condition is true. The code above will print the words Happy Birthday 10 times, namely until the counter variable named pintCounter equals a value of 10.