DelphiBasics
Byte
Type
An integer type supporting values 0 to 255 System unit
type Byte = 0..255;
Description
The Byte type is the smallest form of integer, occupying 8 bits (1 byte) of storage.
 
It supports only the positive integers from 0 to 255.
Related commands
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
ShortIntAn integer type supporting values -128 to 127
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 maximum and minimum byte values
var
  min, max : Byte;
begin
  // Set the minimum and maximum values of this data type
  min := Low(Byte);
  max := High(Byte);
  ShowMessage('Min byte value = '+IntToStr(min));
  ShowMessage('Max byte value = '+IntToStr(max));
end;
Show full unit code
  Min byte value = 0
  Max byte value = 255
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page