枚举构造函数

枚举

type
  TSize = (Small, Middle, Large);

const
  //enums have no constructors: the
  //idiom is a lookup array over the enum
  SizeNames: array[TSize] of string =
    ('S', 'M', 'L');

begin
  WriteLn('sizeName is ', SizeNames[Small]);
  //sizeName is 'S'
end.