Difference between revisions of "Until"

From Free Pascal wiki
Jump to navigationJump to search
m
m
Line 4: Line 4:
 
This [[Keyword|keyword]]  is used in a control construct that is similar to a [[While|while]] or [[Do|do]] loop.
 
This [[Keyword|keyword]]  is used in a control construct that is similar to a [[While|while]] or [[Do|do]] loop.
  
Syntax:
+
==Syntax==
  
   '''repeat'''
+
<syntaxhighlight>
  '''  <statement block>'''
+
   repeat
   '''until <condition>;'''
+
    <statement block>
 +
   until <condition>;
 +
</syntaxhighlight>
  
<statement block>: A single pascal statement or a begin-end statement block.
+
* <statement block>: A single pascal statement or a begin-end statement block.
 +
* <condition>: Expression that eveluates to a boolean value.
  
<condition>: Expression that eveluates to a boolean value.
+
==Example==
  
Example:
+
<syntaxhighlight>
 
+
   x := 1;
   '''x := 1;'''
+
   repeat
   '''repeat'''
+
    DoSomethingHere(x);
  '''begin'''
+
    x := x + 1;
  '''  DoSomethingHere(x);'''
+
   until x = 10;
  '''  x := x + 1;'''
+
</syntaxhighlight>
   '''end;'''
 
  '''until x = 10;'''
 
  
  
 
{{Keywords}}
 
{{Keywords}}

Revision as of 18:40, 14 February 2018

Deutsch (de) English (en) français (fr) русский (ru)

This keyword is used in a control construct that is similar to a while or do loop.

Syntax

  repeat
    <statement block>
  until <condition>;
  • <statement block>: A single pascal statement or a begin-end statement block.
  • <condition>: Expression that eveluates to a boolean value.

Example

  x := 1;
  repeat
    DoSomethingHere(x);
    x := x + 1;
  until x = 10;



Keywords: begindoelseendforifrepeatthenuntilwhile