O'Reilly logo

Special Edition Using Microsoft® Visual Basic® .NET by Jeff Spotts, Brian Siler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with Loops

The other major type of control statement is the loop. You use loops to perform repetitive tasks in your program. Each time the task repeats, the loop is said to have completed an iteration. The three main types of loops are supported by Visual Basic: counter loops, conditional loops, and enumerator loops. Counter, or For, loops perform a task a set number of times. Conditional, or Do, loops perform a task while a specified condition exists or until a specified condition exists. Enumerator loops are used to perform an action on each item in a group of objects. Each of these types of loops is discussed in the following sections.

For Loops

A counter loop also is known as a For loop, or a For/Next loop, because the ends of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required