Home > Articles > Programming > Windows Programming

  • Print
  • + Share This
This chapter is from the book

3.9 Do/LoopUntil Repetition Structure

The Do/LoopUntil structure is similar to the DoUntil/Loop structure, except that the loop-continuation condition is tested after the body of the loop is performed; therefore, the body of the loop executes at least once. When a Do/Loop Until terminates, execution continues with the statement after the LoopUntil clause. As an example of a Do/Loop Until repetition structure, once again consider the segment designed to find the first power of two larger than 1000:

Dim product As Integer = 1

      product = product * 2 
Loop Until product >= 1000 
  • + Share This
  • 🔖 Save To Your Account