您的位置:首页 > 其它

定义二维结构体常量数组

2010-07-12 15:17 351 查看
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: