procedure TForm1.Button1Click(Sender: TObject); var b: Byte; w: Word; i: Integer; c: Cardinal; begin ShowMessage(IntToStr(SizeOf(b))); //Byte大小:1 ShowMessage(IntToStr(High(b))); //Byte最大值: 255 ShowMessage(IntToStr(Low(b))); //Byte最小值: 0 ShowMessage(IntToStr(SizeOf(w))); //Word大小:2 ShowMessage(IntToStr(High(w))); //Word最大值: 65535 ShowMessage(IntToStr(Low(w))); //Word最小值: 0 ShowMessage(IntToStr(SizeOf(i))); //Integer大小:4 ShowMessage(IntToStr(High(i))); //Integer最大值: 2147483647 ShowMessage(IntToStr(Low(i))); //Integer最小值: -2147483648 ShowMessage(IntToStr(SizeOf(c))); //Cardinal大小:4 ShowMessage(IntToStr(High(c))); //Cardinal最大值: 4294967295 ShowMessage(IntToStr(Low(c))); //Cardinal最小值: 0 end;
Integer -2147483648..2147483647 signed 32-bit
Cardinal 0..4294967295 unsigned 32-bit
Shortint -128..127 signed 8-bit
Smallint -32768..32767 signed 16-bit
Longint -2147483648..2147483647 signed 32-bit
Int64 -2^63..2^63? signed 64-bit
Byte 0..255 unsigned 8-bit
Word 0..65535 unsigned 16-bit
Longword 0..4294967295 unsigned 32-bit