Sign in Join
Wiki copytemporary

WordBool

Deutsch · English

Back to data types.

Range of values: True .. False

Memory requirement: 2 bytes or 16 bits

A data field of the WordBool data type can only contain truth values.

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.

The WordBool data type is used like the Boolean data type and the WordBool data type behaves like the Boolean data type.

Definition of a data field of the type WordBool:

pascal
  var 
    w : WordBool;

Examples of assigning valid values:

pascal
  w := True;
  w := false;
  w := 10 <> 20;  // The result of the comparison is true

Examples of assigning invalid values:

pascal
  w := 'True';
  w := 'False';
  w := '10 <> 20';
  w := 24;

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.


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.

Revision 3, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.