Concept Explanation: Infinite Loops

Printer-friendly version


The while command can only accept a single Boolean value. Whatever is inside the conditional statement will always be evaluated to a Boolean. If we want to force a while block to loop continuously, we can simply put a boolean into the while statement. Doing this with a TRUE value will cause something called in infinite loop. Since there is not a conditional statement to change the evaluation to FALSE, the code block will loop continuously. The while command would look something like this: