Endless loop
Also known as an infinite loop or a continuous loop, an endless loop is a continuous repetition of a program segment. For example, when creating a batch file, an endless loop can be created by using the GOTO statement that refers back to the beginning of the loop.
:BEGIN
Echo This is an endless loop!
GOTO BEGIN
As illustrated in the above example, the program will print "This is an endless loop!", go back to the BEGIN statement and repeat this process indefinitely.
- Additional information about creating a loop or rerunning a batch file can be found on document CH001050.
- See document CH001051 for information about canceling or aborting a batch file or program stuck in a loop.
Also see: Loop, Programming definitions
