Visual Basic 2008 Programming: Business Applications with a Design Perspective
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9
Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Appendix A Appendix B Appendix C Home
Last change: February 13 2016 18:48:19.

 Chapter in PDF

Table of Contents

Chapter 7: Repetition
Last change: February 13 2016 18:47:47.

7.3 Additional Notes on Coding Repetition

You have seen all the structures to construct code for repetition. Have you wondered under what situations you should use which structure (a question of suitability)? In addition, recall that statements within the loop will be repeated many times. Any performance efficiency/inefficiency associated with these statements can be magnified dramatically (a question of speed or efficiency). Are there tips that can enhance the efficiency of code for loops? Here are some notes in these regards.

Last change: February 13 2016 18:47:49.
  1. Example 5. Listing a Sequence of Numbers
  2. Example 6. Listing Who’s Invited (the Invitation Project)
  3. Example 7. Every Other Day
  4. Example 8. Displaying a String on Two Lines (the ShowTwoLines Project)
  5. Nesting the Loops
  6. Example 9. Matching Up Teams in a League
  7. Example 10. What Is Your Chance to Win?
  8. The For Each...Next Structure
  • 7.3 Additional Notes on Coding Repetition
    1. Do Versus For
    2. For Versus For Each
    3. Tips for Efficiency
    4. <<PreviousNext>>