IF/fr: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 1 | + | Ce [[Keyword/fr|mot-clé]] précède une condition, et doit être suivi par [[Then/fr|then]] et éventuellement par [[Else/fr|else]]. | |
| 2 | 2 | ||
| 3 | 3 | ## If then | |
| 4 | - | ||
| 5 | - | ||
| 6 | - | ||
| 7 | - | ||
| 4 | + | ||
| 5 | + | ``` pascal | |
| 6 | + | if condition | |
| 7 | + | then true_statement | |
| 8 | + | else false_statement; | |
| 8 | 9 | ``` | |
| 9 | 10 | ||
| 10 | - | ||
| 11 | + | *Condition* est une expression [[Boolean/fr|Boolean]] évaluée à [[True/fr|true]] or [[False/fr|false]]. *true_statement* est exécuté si *condition* est évaluée à True. *false_statement* est exécuté si *condition* est évaluée à False. Une erreur de compilation survient si la condition ne donne pas une valeur booléenne. | |
| 11 | 12 | ||
| 12 | 13 | ### Plus d'instructions dans l'instruction "if then" | |
| 13 | 14 | ||
| 14 | - | ||
| 15 | - | ||
| 16 | - | ||
| 17 | - | ||
| 18 | - | ||
| 19 | - | ||
| 20 | - | ||
| 21 | - | ||
| 15 | + | Si vous avez besoin de plus d'une instruction pour true_statement ou false_statement, placez-les dans un [[Block/fr|bloc]] [[Begin/fr|begin]] ... [[End/fr|end]]. | |
| 16 | + | ||
| 17 | + | ``` pascal | |
| 18 | + | if boolean_condition then | |
| 19 | + | begin | |
| 20 | + | statement_one; | |
| 21 | + | statement_two; | |
| 22 | + | statement_three; | |
| 23 | + | end; | |
| 22 | 24 | ``` | |
| 23 | 25 | ||
| 24 | 26 | ## Documentation | |
| 25 | 27 | ||
| 26 | - | ||
| 27 | - | ||
| 28 | - | ||
| 29 | - | ||
| 28 | + | Documentation officielle : [1](http://www.freepascal.org/docs-html/ref/refsu58.html#x163-18500013.2.3) | |
| 30 | 29 | ||
| 31 | 30 | --- | |
| 32 | - | ||
| 31 | + | *From the Free Pascal wiki, page "If/fr", as it stood on 2020-02-17 after a change by Trev, 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).* |
