WordBool: what changed
Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.
Title: Wordbool WordBool
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 1 | + | Back to [[Data type|data types]]. | |
| 2 | + | ||
| 3 | + | Range of values: True .. False | |
| 4 | + | ||
| 5 | + | Memory requirement: 2 bytes or 16 bits | |
| 6 | + | ||
| 7 | + | A [[Data field|data field]] of the **WordBool** [[Data type|data type]] can only contain truth values. | |
| 8 | + | ||
| 9 | + | Assigning other values leads to compiler error messages when the program is compiled and the compilation process is aborted. This means that the executable program is not created. | |
| 10 | + | ||
| 11 | + | The WordBool data type is used like the Boolean data type and the WordBool data type behaves like the Boolean data type. | |
| 12 | + | ||
| 13 | + | Definition of a data field of the type WordBool: | |
| 14 | + | ||
| 15 | + | ``` pascal | |
| 16 | + | var | |
| 17 | + | w : WordBool; | |
| 18 | + | ``` | |
| 19 | + | ||
| 20 | + | Examples of assigning valid values: | |
| 21 | + | ||
| 22 | + | ``` pascal | |
| 23 | + | w := True; | |
| 24 | + | w := false; | |
| 25 | + | w := 10 <> 20; // The result of the comparison is true | |
| 26 | + | ``` | |
| 27 | + | ||
| 28 | + | Examples of assigning invalid values: | |
| 29 | + | ||
| 30 | + | ``` pascal | |
| 31 | + | w := 'True'; | |
| 32 | + | w := 'False'; | |
| 33 | + | w := '10 <> 20'; | |
| 34 | + | w := 24; | |
| 35 | + | ``` | |
| 36 | + | ||
| 37 | + | The difference between the two examples is that the upper example is the assignment of literals of the type [[Truth value|truth value]], while the assignment of the lower example is literals of the type [[String]] and the type [[Shortint|ShortInt]]. | |
| 38 | + | ||
| 39 | + | --- | |
| 40 | + | *From the Free Pascal wiki, page "WordBool", as it stood on 2023-12-22 after a change by Alextpp, 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).* |
