Boolean/fr: what changed
Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | **Boolean** est un type de donnée logique. Une donnée du type Boolean prend seulement l'une des deux valeurs [[True/fr|True]] ou [[False/fr|False]]. Une variable booléenne occupe un octet en mémoire. | |
| 2 | 2 | ||
| 3 | 3 | La valeur **True** est indique qu'une comparaison ou qu'un test est vérifié ; la valeur **false** indique la valeur Faux pour un test ou une comparaison. | |
| 4 | 4 | ||
| 5 | 5 | ``` pascal | |
| 6 | 6 | var | |
| 7 | 7 | tooLarge : Boolean = false; | |
| 8 | 8 | boolString : ShortString; | |
| 9 | 9 | begin | |
| 10 | 10 | Writeln(tooLarge); | |
| 11 | 11 | tooLarge := (0 = 0); | |
| 12 | 12 | Writeln(tooLarge); | |
| 13 | 13 | tooLarge := (3 > 5); | |
| 14 | 14 | Writeln(tooLarge); | |
| 15 | 15 | tooLarge := true; | |
| 16 | 16 | Writeln(tooLarge); | |
| 17 | 17 | if tooLarge then | |
| 18 | 18 | Writeln('tooLarge is true') | |
| 19 | 19 | else | |
| 20 | 20 | Writeln('tooLarge is false'); | |
| 21 | 21 | WriteStr(boolString,tooLarge); | |
| 22 | 22 | Writeln(boolString); | |
| 23 | 23 | end | |
| 24 | 24 | ``` | |
| 25 | 25 | ||
| 26 | 26 | Ouputs: | |
| 27 | 27 | ||
| 28 | - | ||
| 28 | + | ```text | |
| 29 | 29 | FALSE | |
| 30 | 30 | TRUE | |
| 31 | 31 | FALSE | |
| 32 | 32 | TRUE | |
| 33 | 33 | tooLarge is true | |
| 34 | 34 | TRUE | |
| 35 | 35 | ``` | |
| 36 | 36 | ||
| 37 | 37 | ## Lire en plus | |
| 38 | 38 | ||
| 39 | 39 | - [[Basic Pascal Tutorial/Chapter 3/Boolean Expressions/fr|Expressions booléennes]] | |
| 40 | 40 | ||
| 41 | 41 | --- | |
| 42 | 42 | *From the Free Pascal wiki, page "Boolean/fr", as it stood on 2023-01-25 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).* |
