DelphiBasics
Word
Type
An integer type supporting values 0 to 65535 System unit
type Word = 0..65535;
Description
The Word type is an integer holding positive values up to 65535. It occupies 16 bits of storage.
 
The SmallInt type is the equivalent 16 bit type for signed integers (-32768 to 32767).
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
ShortIntAn integer type supporting values -128 to 127
SmallIntAn Integer type supporting values from -32768 to 32767
 Download this web site as a Windows program.




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