Boolean/fr: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Boolean/fr
| Old | New | Line | |
|---|---|---|---|
| 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 | + | ||
| 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 | + | ||
| 5 | + | ``` pascal | |
| 6 | + | var | |
| 7 | + | tooLarge : Boolean = false; | |
| 8 | + | boolString : ShortString; | |
| 9 | + | begin | |
| 10 | + | Writeln(tooLarge); | |
| 11 | + | tooLarge := (0 = 0); | |
| 12 | + | Writeln(tooLarge); | |
| 13 | + | tooLarge := (3 > 5); | |
| 14 | + | Writeln(tooLarge); | |
| 15 | + | tooLarge := true; | |
| 16 | + | Writeln(tooLarge); | |
| 17 | + | if tooLarge then | |
| 18 | + | Writeln('tooLarge is true') | |
| 19 | + | else | |
| 20 | + | Writeln('tooLarge is false'); | |
| 21 | + | WriteStr(boolString,tooLarge); | |
| 22 | + | Writeln(boolString); | |
| 23 | + | end | |
| 24 | + | ``` | |
| 25 | + | ||
| 26 | + | Ouputs: | |
| 27 | + | ||
| 28 | + | `FALSE`\ | |
| 29 | + | `TRUE`\ | |
| 30 | + | `FALSE`\ | |
| 31 | + | `TRUE`\ | |
| 32 | + | `tooLarge is true`\ | |
| 33 | + | `TRUE` | |
| 34 | + | ||
| 35 | + | ## Lire en plus | |
| 36 | + | ||
| 37 | + | - [[Basic Pascal Tutorial/Chapter 3/Boolean Expressions/fr|Expressions booléennes]] | |
| 38 | + | ||
| 39 | + | --- | |
| 40 | + | *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).* |
