定义二维结构体常量数组

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.

上一篇:go语言数据结构之-稀疏数组


下一篇:如何使用ABAP code inspector找出所有在LOOP里访问database的操作