A loop is a software program or script that repeats the same instructions or processes the same information over and over until receiving the order to stop. If not handled properly, a loop can cause the computer to become slower as it becomes overwhelmed with repeating the same steps in an endless loop.
Batch file loop
Below is a basic example of a loop in a batch file.
:BEGIN Echo Here is an endless loop! GOTO BEGIN
Other types of loops
Below are examples of common types of loops in many programming languages. Visit each of these pages for additional information and examples about each loop.
- Do loop
- For loop
- Foreach loop
- Goto loop
- While loop
Control statement, Endless loop, Feedback, Goto, Iteration, Loop device, Programming terms, Repeat counter, Repetition, STP
Related information
- How to loop or start a batch file over after it has completed.
- How to abort a batch file, command, or program stuck in a loop.
- How to create a computer program.
- How to loop a YouTube video.