Free Pascal Lazarus Program Tutorial 7 - While Loop


Loops are useful for having the computer repeat commands over and over. There are three types of loops in Free Pascal. The loops include the While Loop, Repeat Until, and the For Loop. There must be a condition met to end the loop. If the condition is not met, the computer will go into a infinite loop. Sometimes the infinite loop will lock the computer or cause the user to have to force quite the program.

This tutorial will show the While loop.

While Loop Syntax
while <condition> do
begin
   computer does something;
end;

Code Download
FPProgT7.zip