ObjectPascal
Boolean
Type
Allows just True and False values System unit
  type Boolean = (False, True);
Description
The Boolean type provides an enumeration of the logical True and False values.
 
Unlike other languages, it is not a number - it will only allow these values. This makes the code much more reliable.
Notes
Using calculations to test for true or false is a C like practice, but is supported in Delphi. Use the following to hold such a logical number:

ByteBool
WordBool
LongBool

Related commands
And Boolean and or bitwise and of two arguments
If Starts a conditional expression to determine what to do next
Not Boolean Not or bitwise not of one arguments
Or Boolean or or bitwise or of two arguments
Xor Boolean Xor or bitwise Xor of two arguments
 
Example code : Boolean assignments and tests
var
  same : Boolean;
  small, large, i : Integer;

begin
  small := 23;
  large := 455555;

  // Test directly to see if these numbers are the same size
  if small = large
  then WriteLn('small = large')
  else WriteLn('small <> large');

  // Use a Boolean to hold and test this outcome
  same := (small = large);
  if same
  then WriteLn('small = large')
  else WriteLn('small <> large');

  // Assign a direct logical value to this Boolean
  same := True;
  if same
  then WriteLn('same is True')
  else WriteLn('same is False');
end;
Show full unit code
   small <> large
   small <> large
   same is True