DelphiBasics
MaxLongInt
Constant
The maximum value an LongInt can have System unit
const MaxLongInt = High(LongInt);
Description
The MaxLongInt constant gives the largest allowed value for a LongInt.
 
The value is (2^31) -1 = 2,147,483,647
 
It is often used when the size of something, such as an array, is unknown.
Related commands
LongIntAn Integer whose size is guaranteed to be 32 bits
MaxIntThe maximum value an Integer can have
 Download this web site as a Windows program.




 
Example code : Copying the trailing characters of a string
var
  Source, Target : string;

begin
  Source := 'Assume that we do not know how long this string is';

  // Copy all characters from the 8th onwards
  Target := Copy(Source, 8, MaxLongInt);

  ShowMessage('Source : '+Source);
  ShowMessage('Target : '+Target);
end;
Show full unit code
  Source : Assume that we do not know how long this string is
  Target : that we do not know how long this string is
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page