1. Technology

Chapter 7 - Using Loops and Timers - Part 1

By

1 of 8

What good is a program that will only do something once?
While ... End While

Chapter seven of our book, Visual Basic .NET Step by Stepis a short (just 23 pages!) but important chapter because loops and timers are the way you multiply the effect of your program by getting it to do something more than once. The calculator program mentioned in the lesson for Chapter 6 is a great example of a program that doesn't really need looping because it only does something once (that is, it performs one calculation based on key input). But most programs need to "double back" and repeat the same code. Or, perhaps execute the code at specific time intervals using the Timer control.

An example of how important loops are is the experience that people sometimes have of starting a program then discovering that the speed of your computer has suddenly slowed down to a crawl. The chances are good that the program you just started is "stuck in a loop" somehow. This chapter shows you how to do it right so that doesn't happen in the code you write.

So ... Lets get looping!

  1. About.com
  2. Technology
  3. Visual Basic
  4. Learn VB.NET
  5. Using Loops and Timers - Part 1

©2014 About.com. All rights reserved.