Loops

From Free Pascal wiki
Revision as of 12:37, 17 January 2020 by Trev (talk | contribs) (English translation of German page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Deutsch (de) English (en)

A loop is a sequence of instructions that is repeated until a certain condition is reached. An operation is done (eg getting an item of data and changing it) and then some condition is checked (eg whether a counter has reached a specified number).

A loop has a loop head, a loop foot and a loop body.

The conditions under which a loop is run are either in the loop head or in the loop foot. The instructions to be processed are in the loop body.

Free Pascal has four types of loops:

   Head-controlled Counting loop For ...
   Head-controlled loop While ...
   Repeat foot controlled loop
   Head-controlled For-In Loop For ... In ...

See also