Hi,
The compiler is doing the right thing and the reason what you want and, are trying to do doesn't work is a bit subtle but not much.
The declaration:
Points: array[0..2] of TPoint = (Point1, Point2, Point3);
is invalid because the only way to make it valid is to _copy_ Point1, Point2 and Point3 into the Points array. The compiler won't do that for you.
What you're trying to do can be done if you change the declarations a bit. The following example works and does what you are trying to do (albeit in a different way than the one you attempted):
program InitializedStucturedConstants;
type
PPoint = ^TPoint;
TPoint = record
X, Y: Single;
end;
const
Point1: TPoint = (X: 0.0; Y: 0.0);
Point2: TPoint = (X: 1.0; Y: 1.0);
Point3: TPoint = (X: 2.0; Y: 2.0);
//Points: array[0..2] of TPoint = (Point1, Point2, Point3);
Points : array[0..2] of PPoint = (@Point1, @Point2, @Point3);
begin
with Points[1]^ do writeln('X : ', X, ' Y : ', Y);
end.
To reference the points you've declared, you need to use pointers to them. You cannot use the points themselves because then the const Point1 and the array element Point1 are two _distinct_ items in memory, not the same one which is probably what you want it to be.
HTH.