Delphi 取16进制字符的10进制的integer值


本文整理自网络,侵删。

 
(*********************取16进制字符的10进制的integer值*******************)
function HexToInt(HexStr:String):Integer;
var
  i,TempInt,LocalInt:Integer;
begin
  HexStr:=UpperCase(HexStr);
 
  LocalInt:=1;
  Result:=0;
  for i:=Length(HexStr) downto 1 do
  begin
    if HexStr[i] in ['0'..'9'] then
      TempInt:=StrToInt(HexStr[i])
    else
      TempInt:=Ord(HexStr[i])-Ord('A')+10;
 
    if i=Length(HexStr) then
      LocalInt:=1
    else
      LocalInt:=LocalInt*16;
 
    Result:=Result+TempInt*LocalInt;
  end;
end;
//*********************取16进制字符的10进制的integer值**************

相关阅读 >>

Delphi使用idhttp模拟提交页面方法总结

Delphi idhttp post

Delphi unicode转换ansi

Delphi关闭进程

Delphi uac相关代码

Delphi的split函数 4个版本

Delphi 安装apk

Delphi 取正在运行的dll或exe的路径

获取剪贴板文字内容的代码

Delphi利用文件流把文件拆分与合并

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...