O'Reilly logo

Microsoft® Visual Basic® 2010 Developer’s Handbook by Klaus Löffelmann and Sarika Calla Purohit

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

Loops

Loops let you to run the commands and the statements they contain over and over again, until a certain loop end state (called an exit condition) is achieved. Referring back to Figure 1-6, you can see an example of a loop in a Do ... Loop construct, which allows users to repeatedly enter birth dates or commands until they type a whitespace (a space or a tab or a return) at the command prompt. When that happens, the variable input stays empty, and the loop reaches its exit condition, which was defined after the keyword Loop.

In addition to Do ... Loop, Visual Basic recognizes For ... Next loops, which repeat all internal statements until a counter variable has exceeded or dropped below a specified value. Also, in Visual Basic, you can use ...

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