O'Reilly logo

Absolute Beginner's Guide to Programming, Second Edition by Greg Perry

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

Looping in Visual Basic

In addition to decision statements, all programming languages enable you to write statements that repeat themselves a certain number of times. These statement blocks are called loops. Loops play an important role in programs because you will need to repeat sections of a program to process multiple data values. For example, you might need to calculate a total of past due charges for all customers. A loop can read each customer's past due charges and add that amount to the running total.

The Do While Loop

The Do statement is a fundamental looping statement in Visual Basic and in many other languages, and it comes in several formats. Visual Basic supports several versions of the Do statement. The Do While loop is perhaps ...

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