uses TypInfo; |
type |
TCommType = (cEm, cDm, cMd); |
|
TCommTypeCon = class |
public |
class function CommToStr(nComm: TCommType): string ; |
class function StrToComm( const nStrComm: string ): TCommType; |
end ; |
|
implementation |
|
class function TCommTypeCon . CommToStr(nComm: TCommType): string ; |
begin |
Result := GetEnumName(TypeInfo(TCommType), Ord(nComm)); |
end ; |
|
class function TCommTypeCon . StrToComm( const nStrComm: string ): TCommType; |
begin |
Result := TCommType(GetEnumValue(TypeInfo(TCommType), nStrComm)); |
———————————————— |
版权声明:本文为CSDN博主「dw . z」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 |
原文链接:https: //blog.csdn.net/zdwcmy/article/details/106784861 |