Programming > Visual Basic > Downloads > Loops
This is a program demonstrating different types of loop, and how they can be used. The outline of the program is given below:
- There are 4 buttons in the program that invoke the different loops.
- The first button, which demonstrates a "for" loop, causes a message box displaying the word "hi" to be shown 4 times. This cannot be changed by a user of the program, but you can change the message or amount of times it is shown by editing the source code.
- The second button demonstrates a "while" loop. When clicked, the user is prompted to enter a password, and while the correct password ("computing") has not been entered, the password prompt continues to loop.
- The third button is the same in function as the second button, but it uses a "do" loop instead.
- The second "for" loop button requires the user to enter a number into a text box. When the button is clicked, consecutive message boxes are displayed counting up to the number entered in the text box. If a large number is entered, the loop will go on for a long time!
Download Now   (7KB Zip file)
Search for "Visual Basic" on:
eBay (UK) |
Search for "Visual Basic" on the rest of Computing Students: Visual Basic
Find Visual Basic (VB) Programming Books in the Computing Students Computer Science Book Shop