Object Pascal - Break statement: break

Used for the immediate interruption of the loop. after execution, will proceed with the following command after loop.

break

Description

break ;
Used keywords: break

Examples

Object Pascal

Even one example in what situations we can use the operation break statement:
i:=10;
repeat dec(i) until not i > 0;
repeat
  inc(i);
  if i=5 then
    break;
until not i <10;

Object Pascal

Other pieces of example codes:
if i=10 then
     break
   else 
   begin
     dec(i)
   end
if i=3 then
    break;
Languages: en hu cz sk