本文整理自网络,侵删。
Function Str_HexToInt(Hex: String): integer; Var HexDigital: Set Of char; i: integer; Digital: String; Begin Result := 0; HexDigital := ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'A', 'B','C','D', 'E', 'F', 'a', 'b', 'c', 'd', 'e', 'f']; If Length(Hex) = 0 Then Exit; For i := 1 To Length(Hex) Do Begin Digital := Copy(Hex, i, 1); If (i = 1) And (digital = '$') Then Continue; End; Digital := Copy(Hex, 1, 1); If Digital <> '$' Then Hex := '$' + Hex; //Result := StrToInt(Hex); Str_HexToInt:=StrToInt(Hex) ; End; 整数转换为16进制字符串str := InttoHex()
相关阅读 >>
Delphi firedac 连接sql server一些要注意的地方
Delphi环境下基于spcomm控件开发串口通讯报文字节丢失的问题解决
更多相关阅读请进入《Delphi》频道 >>