Difference between revisions of "Repeat"
From Free Pascal wiki
Jump to navigationJump to search (clean up syntax) |
Tag: Undo |
||
Line 1: | Line 1: | ||
{{Repeat}} | {{Repeat}} | ||
− | + | This [[Reserved word|reserved word]] is used in a control construct that is similar to a [[While|<syntaxhighlight lang="pascal" enclose="none">while</syntaxhighlight>]] [[Do|<syntaxhighlight lang="pascal" enclose="none">do</syntaxhighlight>]] loop. | |
==Syntax== | ==Syntax== | ||
Line 11: | Line 11: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | * <statement block>: | + | * <statement block>: A single [[Pascal]] [[statement]] or a [[Begin|<syntaxhighlight lang="pascal" enclose="none">begin</syntaxhighlight>]]-[[End|<syntaxhighlight lang="pascal" enclose="none">end</syntaxhighlight>]] statement block. |
* <condition>: [[expression|Expression]] that evaluates to a [[Boolean|<syntaxhighlight lang="pascal" enclose="none">boolean</syntaxhighlight>]] value. | * <condition>: [[expression|Expression]] that evaluates to a [[Boolean|<syntaxhighlight lang="pascal" enclose="none">boolean</syntaxhighlight>]] value. | ||
Revision as of 23:19, 20 November 2020
│
Deutsch (de) │
English (en) │
suomi (fi) │
français (fr) │
русский (ru) │
This reserved word is used in a control construct that is similar to a while
do
loop.
Syntax
repeat
<statement block>
until <condition>;
- <statement block>: A single Pascal statement or a
begin
-end
statement block. - <condition>: Expression that evaluates to a
boolean
value.
Example
x := 1;
repeat
DoSomethingHere(x);
x := x + 1;
until x = 10;
Keywords: begin — do — else — end — for — if — repeat — then — until — while