Break

From Free Pascal wiki
Revision as of 19:01, 14 October 2015 by FTurtle (talk | contribs) (Translated from Break/de)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Deutsch (de) English (en) español (es) suomi (fi) français (fr) русский (ru)

The reserved word break is one of the loop commands
The command is used to exit a loop before its planned end.
The break command can only be used within loops.

Example:

var
  intI: Integer;
  intA: Integer = 50;
begin
  for intI := 20 to 200 do
  begin
      ...
      if intI = intA then break; // If the condition is satisfied, the loop is terminated
      ...
  end;
end;


See also