孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

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.

posted on 2010-07-12 15:17  孤独的猫  阅读(509)  评论(0编辑  收藏  举报