LongBool: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
Title: LongBool Longbool
| Old | New | | Line |
|---|
| 1 | | - | Back to [[Data type|data types]]. |
| 2 | | - | |
| 3 | | - | Range of values: True .. False |
| 4 | | - | |
| 5 | | - | Memory requirement: 4 bytes or 32 bits |
| 6 | | - | |
| 7 | | - | A data field of the **LongBool** 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 **LongBool** data type is used like the Boolean data type and behaves like the [[Boolean]] data type. |
| 12 | | - | |
| 13 | | - | Declaration of a data field of type LongBool: |
| 14 | | - | |
| 15 | | - | ``` pascal |
| 16 | | - | var |
| 17 | | - | l : LongBool; |
| 18 | | - | ``` |
| 19 | | - | |
| 20 | | - | Examples of assigning valid values: |
| 21 | | - | |
| 22 | | - | ``` pascal |
| 23 | | - | l := true; |
| 24 | | - | l := false; |
| 25 | | - | l := 10 <> 20 ; // The result of the comparison is true |
| 26 | | - | ``` |
| 27 | | - | |
| 28 | | - | Examples of assigning invalid values: |
| 29 | | - | |
| 30 | | - | ``` pascal |
| 31 | | - | l := 'True'; |
| 32 | | - | l := 'False'; |
| 33 | | - | l := '10 <> 20'; |
| 34 | | - | l := 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]], 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 "LongBool", 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).* |
| 1 | + | #REDIRECT [[LongBool]] |
Back to history