CS100 Chapter Notes - Chapter 7: The Exit

68 views2 pages

Document Summary

Loops are used when you need to repeat a piece of code over and over. For loops: used when you know exactly how many times the loop needs to run. Do loops: used when you don"t know the exact number of times a loop should run. For i = 1 to 10 label1. text = label1. text & i. Loops can be used to create a delay in a program. In the previous program all values of the loop appeared at once because the computer is very fast. For i = 1 to 20 step 3. Label1. text = label1. text & & i. You can break out of a for loop at any time by using the command exit for . The general form of a do loop is: For j = 1 to 100000000 larger = more delay. The second option will always allow the loop to run at least once. Timers are controls that loop based on a given interval.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents