2026年5月21日 星期四

Delphi Enum 轉字串

 

uses
  System.TypInfo;

type
  TDataState = (stInquiry, stNew, stEdit, stDelete, stRecall);

function DataStateToString(AState: TDataState): string;
begin
  Result := GetEnumName(TypeInfo(TDataState), Ord(AState));
end;



沒有留言:

張貼留言