Implementation goes this way:
type
TSampleEnumType = (seNone, seONE, seTWO, seTHREE, seFOUR);
TSampleRecord = record
SampEType: TSampleEnumType;
iValue: integer;
end;
const
TConstArrayofRecord: array [0..4] TSampleRecord (
(SampEType: seNONE; iValue: 0),
(SampEType: seONE; iValue: 1),
(SampEType: seTWO; iValue: 2),
(SampEType: seTHREE; iValue: 3),
(SampEType: seFOUR; iValue: 4),
);
This can be very usefull when we require to maintain a constant table of mapped values.
I located the method from SysUtils.pas where type ExceptMap is a array of record TExceptRec.
定义二维结构体常量数组
最新推荐文章于 2024-01-14 20:52:21 发布