Delphi 枚举转字符串_枚举类型

implementation  Uses TypInfo;

procedure TForm3.FormCreate(Sender: TObject);
//定义枚举类型
type
  TDayOfWeek=(Monday,Tuesday,Wednesday,Thursday,FriDay,Saturday,Sunday);
var
  s: string;
  aWeek:TDayOfWeek;
begin           
ShowMessage('枚举字符串:' + GetEnumName(TypeInfo(TDayOfWeek),      0)   );
ShowMessage('枚举字符串:' + GetEnumName(TypeInfo(TDayOfWeek),Ord(Monday)));
   aWeek:=Monday;
ShowMessage('枚举字符串:' + GetEnumName(TypeInfo(TDayOfWeek),Ord(aWeek)));
end;

Delphi 枚举转字符串_edn_02

GetEnumName(TypeInfo( System.TTypeKind), ord( pMethod.ReturnType.TypeKind));