Description |
The LongInt type is a 32 bit signed Integer. This size is fixed, and will not change in future releases of Delphi. It is currently the same size as the Integer type.
To hold very large signed integers, use the Int64 type.
|
|
Related commands |
Byte |
|
An integer type supporting values 0 to 255 |
Cardinal |
|
The basic unsigned integer type |
Int64 |
|
A 64 bit sized integer - the largest in Delphi |
Integer |
|
The basic Integer type |
LongWord |
|
A 32 bit unsigned integer |
ShortInt |
|
An integer type supporting values -128 to 127 |
SmallInt |
|
An Integer type supporting values from -32768 to 32767 |
Word |
|
An integer type supporting values 0 to 65535 |
|
|
|
|
Example code : Showing the capacity of LongInt |
// Full Unit code. // ----------------------------------------------------------- // You must store this code in a unit called Unit1 with a form // called Form1 that has an OnCreate event called FormCreate. unit Unit1; interface uses // The System unit does not need to be defined SysUtils, Forms, Dialogs; type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); end; var Form1: TForm1; implementation {$R *.dfm} // Include form definitions procedure TForm1.FormCreate(Sender: TObject); var
min, max : LongInt;
begin // Set the minimum and maximum values of this data type
min := Low(LongInt);
max := High(LongInt);
ShowMessage('Min longint value = '+IntToStr(min));
ShowMessage('Max longint value = '+IntToStr(max));
end;
end.
|
Hide full unit code |
Min longint value = -2147483648
Max longint value = 2147483647
|
|