Despite what Delphi says,
structured types may contain other structured types; a type can have an unlimited level of structuring
with the notable exception that structured typed constants
cannot contain file type values ββat any level
I found that I can not use the write constant as an element of an array constant of the same type.
Testcase
type
MyRecord = record MyField: Integer end;
const
Typical: array[0..1] of MyRecord = ((MyField: 0), (MyField: 1));
{ now I tried to achieve more clarity by declaring a specific constant }
Zero: MyRecord = (MyField: 0);
{ and compiler refused to accept that }
Bad: array[0..1] of MyRecord = (Zero, (MyField: 1)); { E2029 '(' expected but identifier 'Zero' found }
I tested this code with several Borland compilers, they all showed the same behavior. UPD: the same for FPC, but not for GPC (!).
Question (s)
? " " ? ?