ShortInt

From SCAR Divi Manual
Jump to: navigation, search

Availability

SCAR Divi 3.00 > Current

Description

ShortInt is a basic type which can hold an 8-bits signed integer value (-128..127), any value outside of the range that is stored in it will overflow back into the range. Byte is the unsigned version of this type.

Example

var
  Value: ShortInt;

begin
  Value := 0;
  WriteLn(Value);
  Value := 127;
  WriteLn(Value);
  Value := -1;
  WriteLn(Value);
  Value := -128;
  WriteLn(Value);
  Value := 128;
  WriteLn(Value);
end.

Output:

0
127
-1
-128
-128

See Also