© John Kouraklis 2020
J. KouraklisDelphi Quick Syntax Referencehttps://doi.org/10.1007/978-1-4842-6112-5_3

3. Looping, Conditional and Jump Statements

John Kouraklis1 
(1)
London, UK
 

Loops

Loops allow a chunk of code to be executed as long as a control condition is valid (true) or for specific number of iterations. In Delphi, you manage loops either by using a while, a repeat, or a for statement.

While Statement

A while..do statement executes the designated code as long as the condition that appears between the keywords while and do (control condition) is true. The evaluation of the control statement is done in the very beginning of the loop, which means that the relevant code may or may not be executed at all.
var
  whileControl: Integer;
begin
  whileControl:=0; ...

Get Delphi Quick Syntax Reference: A Pocket Guide to the Delphi and Object Pascal Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.