type
TCommandType = (ctEmptyCommand,ctAdd,ctModify);
TCommandTypeConvert=class
public
class function CommandToString(ACommand: TCommandType): string;
class function StringToCommand(const AStrCommand: string): TCommandType;
end;
implementation
class function TCommandTypeConvert.CommandToString(ACommand: TCommandType): string;
begin
Result := GetEnumName(TypeInfo(TCommandType),Ord(ACommand));
end;
class function TCommandTypeConvert.StringToCommand(const AStrCommand: string): TCommandType;
begin
Result := TCommandType(GetEnumValue(TypeInfo(TCommandType), AStrCommand));
end;
end.
delphi枚举与字符串转换
转载rosehacker2010 博主文章分类:Delphi学习
文章标签 职场 休闲 delphi枚举与字符串转换 文章分类 运维
下一篇:Delphi指针操作数组
-
Delphi造一个简易迷宫
尝试用Delphi、DFS深度优先搜索算法造一个迷宫,使用DFS实现寻路并展示画出来。
DFS 深度优先搜索 DFS深度优先搜索 -
delphi TMemo当前位置插入字符 delphi insert into
就是写了一个for循环插入数据: for j := 0 to Num - 1 do begin .......... UniQuery1.SQL.Add('insert into ....... UniQuery1.ExecSQL; .........
delphi unidac sqlite database is locked insert into -
Delphi编程--字符处理
Delphi字符处理函数
字符串 文件名 多字节 ico 字节数

















