March 2000
Intermediate to advanced
576 pages
18h 13m
English
MaxInt Constant
const MaxInt = High(Integer);
MaxInt is the largest possible value of type
Integer. The constant is a convenient shorthand
for High(Integer). The exact value of
MaxInt can change from one release of Delphi to
another. Currently, it has the value 2,147,483,647.
A common idiom when writing code that must interface with C or C++ libraries (including the Windows API) is to declare an array with the largest possible dimensions. A separate function parameter or record member holds the true array size. The maximum array dimension depends on the size of the base type, so you can declare the array type as follows:
typeCArray= array[0..MaxInt div SizeOf(BaseType) - 1] ofBaseType;
| Integer Type, MaxLongInt Constant |
Read now
Unlock full access