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 ...

Get Absolute Beginner's Guide to Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.