RAD Studio Athens

E2100

Go Up to Error and Warning Messages (Delphi)

You have specified a data type which is too large for the compiler to represent. The compiler will generate this error for datatypes which are greater or equal to 2 GB in size. You must decrease the size of the description of the type.


program Produce;

  type
    EnormousArray = array [0..MaxLongint] OF Longint;
    BigRecord = record
      pointsย : array [1..10000] of Extended;
    end;

  var
    dataย : array [0..500000] of BigRecord;

begin
end.

It is easily apparent to see why these declarations will elicit error messages.


program Solve;
  type
    EnormousArray = array [0..MaxLongint DIV 8] OF Longint;

    DataPoints = ^DataPointDesc;
    DataPointDesc = array [1..10000] of Extended;
    BigRecord = record
      pointsย : DataPoints;
    end;

  var
    dataย : array [0..500000] OF BigRecord;


begin
end.

The easy solution to avoid this error message is to make sure that the size of your data types remain under 2Gb in size. A more complicated method would involve the restructuring of your data, as has been begun with the BigRecord declaration.