6.6. Do...Loop While Repetition Statement

The Do...Loop While repetition statement is similar to the While statement and Do While...Loop statement. In the While and Do While...Loop statements, the loop-continuation condition is tested at the beginning of the loop, before the body of the loop is performed. The Do...Loop While statement tests the loop-continuation condition after the loop body is performed; therefore, in a Do...Loop While statement, the loop body is always executed at least once. When a Do...Loop While statement terminates, execution continues with the statement after the Loop While clause. The program in Fig. 6.12 uses a Do...Loop While statement to output the values 1–5.

Figure 6.12. Do...Loop While repetition statement.
					

Get Visual Basic 2005 for Programmers: Deitel Developer Series, 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.