More Than One Way to Loop

A loop is a repetitive programming construct that allows a statement or a series of statements to process over and over again until a condition is met. Consequently, loops provide an excellent way to cycle through code. If you are examining a string, you can cycle through one character or word at a time. If you are incrementing a number, each loop can add another value to your number. If you are looking for an object in a collection of objects, the loop is the perfect vehicle to enumerate (list) your objects.

Do..Loop

The Do..Loop statement executes code inside the Do..Loop either while a condition remains true or until a condition becomes true, depending on how the statement is constructed. There are two ways to use ...

Get Access 2002 Programming by Example 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.