zoukankan      html  css  js  c++  java
  • delphi inttohex 整型到十六进制

    inttohex

    from delphi help:

    Returns the hex representation of an integer.

    Unit

    SysUtils

    Category

    numeric formatting routines

    Delphi syntax:

    function IntToHex(Value: Integer; Digits: Integer): string; overload;
    function IntToHex(Value: Int64; Digits: Integer): string; overload;

    C++ syntax:

    extern PACKAGE AnsiString __fastcall IntToHex(int Value, int Digits);
    extern PACKAGE AnsiString __fastcall IntToHex(__int64 Value, int Digits);

    Description

    IntToHex converts a number into a string containing the number's hexadecimal (base 16) representation. Value is the number to
    convert. Digits indicates the minimum number of hexadecimal digits to return.

    功能说明:该函数用于将“十进制”转换成“十进制”。该函数有二个参数。第一个参数为要转换的十进制数据,第二个参数是指定使用多少位来
    显示十六进制数据。
      参考实例:
      Edit1.Text := IntToHex(100, 2);
      执行结果,Edit1.Text等于64。
      注意:Delphi没有提供专门的“十六进制”转换为“十进制”的函数。使用StrToInt函数可以实现这个功能。具体代码是:I := StrToInt('$'
    + '64'); 这时I等于100。加上一个'$'即可将“十六进制”转换为“十进制”。

    showmessage(IntTostr(StrToint( '$ '+edit1.text)));

  • 相关阅读:
    树莓派开发实战(第2版)
    Windows 7+Office 2010综合应用培训教程
    Adobe Edge Animate CC
    从零开始学采购:供应商管理与采购过程控制
    iOS项目开发全程实录
    SEO搜索引擎实战详解
    Photoshop移动UI设计完全实例教程
    游戏开发物理学
    psd,
    放到 userdefault,而不是 cache里面,
  • 原文地址:https://www.cnblogs.com/bwdblogs/p/10495340.html
Copyright © 2011-2022 走看看