枚举类型

来源:互联网 发布:mac桌面文件夹丢失 编辑:程序博客网 时间:2024/05/22 20:15
type
  TCountryCodes = (CHN, BRA, DEU, RUS);

function GetCountryName(const CountryCode: TCountryCodes): string;
const
  CountryNames: array[TCountryCodes] of string = ('中国', '巴西', '德国', '俄罗斯');
begin
  result := CountryNames[CountryCode];
end;