DelphiBasics
ShortInt
Type
An integer type supporting values -128 to 127 System unit
type ShortInt = -128..127;
Description
The ShortInt type is the smallest form of signed integer, occupying 8 bits (1 byte) of storage.
 
It supports only the integers from -128 to 127.
Related commands
ByteAn integer type supporting values 0 to 255
CardinalThe basic unsigned integer type
Int64A 64 bit sized integer - the largest in Delphi
IntegerThe basic Integer type
LongIntAn Integer whose size is guaranteed to be 32 bits
LongWordA 32 bit unsigned integer
SmallIntAn Integer type supporting values from -32768 to 32767
WordAn integer type supporting values 0 to 65535
 Download this web site as a Windows program.




 
Example code : Showing the maximum and minimum values
var
  min, max : ShortInt;
begin
  // Set the minimum and maximum values of this data type
  min := Low(ShortInt);
  max := High(ShortInt);
  ShowMessage('Min short int value = '+IntToStr(min));
  ShowMessage('Max short int value = '+IntToStr(max));
end;
Show full unit code
  Min short int value = -128
  Max short int value = 127
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page