I have next arrays
NAMES1: array[0..1] of string = ('NO1','NAME1');
NAMES2: array[0..1] of string = ('NO2','NAME2');
and a record structure
TMyRec = record(
Name: ????;
);
As result I need to declare a constant array of records like following
const
StringArraysList: array[0..1] of TMyRec = (
(Name: NAMES1),
(Name: NAMES2)
);
The question is what type should I select for Name in TMyRec?
You need to do it like this:
You would prefer to write the final declaration as
But that results in
Some Delphi constants are not as constant as you would like them to be!
The documentation for record constants states that
The documentation for typed constants states that
Put these two rules together and we have
E2026.