Repeat/fr: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Repeat/fr
| Old | New | Line | |
|---|---|---|---|
| 1 | + | Ce [[Keyword/fr|mot-clé]] est utilisé pour une construction itérative semblable à la boucle [[While/fr|while]] [[Do/fr|do]]. | |
| 2 | + | ||
| 3 | + | Syntax: | |
| 4 | + | ||
| 5 | + | ``` pascal | |
| 6 | + | ||
| 7 | + | repeat | |
| 8 | + | <statement block> | |
| 9 | + | until <condition>; | |
| 10 | + | ``` | |
| 11 | + | ||
| 12 | + | \<statement block\>: Une instruction simple ou une suite d'instructions, les begin-end sont inutiles car les instructions sont déjà délimitées par *repeat* et *until*. | |
| 13 | + | ||
| 14 | + | \<condition\>: condition de terminaison de la boucle. | |
| 15 | + | ||
| 16 | + | Exemple: | |
| 17 | + | ||
| 18 | + | ``` pascal | |
| 19 | + | x := 1; | |
| 20 | + | repeat | |
| 21 | + | DoSomethingHere(x); | |
| 22 | + | x := x + 1; | |
| 23 | + | until x = 10 | |
| 24 | + | ``` | |
| 25 | + | ||
| 26 | + | Elle diffère sur deux points d'avec la boucle while: | |
| 27 | + | ||
| 28 | + | - la condition est évaluée après les instructions qui sont donc exécutées au moins une fois | |
| 29 | + | - la boucle prend fin lorsque la condition est vérifiée (on parle de condition de terminaison) | |
| 30 | + | ||
| 31 | + | --- | |
| 32 | + | *From the Free Pascal wiki, page "Repeat/fr", as it stood on 2020-09-05 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
