• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Using Procedures to Customiz... > More Than One Way to Loop

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 the While or Until keywords to check a condition in a Do..Loop statement. You can check the condition before you enter the loop or you can check it after the loop has run at least once.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint