June 2006
Intermediate to advanced
1344 pages
42h 52m
English
The Do...Loop Until repetition statement is similar to the Do Until...Loop statement, except that the loop-termination condition is tested after the loop body is performed; therefore, the loop body executes at least once. When a Do...Loop Until terminates, execution continues with the statement after the Loop Until clause. Figure 6.13 uses a Do...Loop Until statement to print the numbers from 1 to 5.
1 ' Fig. 6.13: DoLoopUntil.vb 2 ' Using Do...Loop Until repetition statement. 3 Module DoLoopUntil 4 Sub Main() 5 Dim counter As Integer = 1 6 7 ' print values 1 to 5 8 Do 9 Console.Write(counter & " " ) 10 counter += 1 11 Loop Until counter >5 12 ... |
Read now
Unlock full access