关于十进制和十六进制的问题????????????????????????????????????????????????
在delphi中有没有表示十六进制的变量??????????????????????
另外如何对十进制和十六进制进行相互转换??????????????????

解决方案 »

  1.   

    inttohex(),看帮助吧。$FF 表示是16进制的。
      

  2.   

    i:=$0a; // i:=10
    str1:=Format('%2x',[i]); //0A
      

  3.   

    用$00000000 表示16进值数职比如$0000FF08IntToHexUnitSysUtilsfunction IntToHex(Value: Integer; Digits: Integer): string; overload;
    function IntToHex(Value: Int64; Digits: Integer): string; overload;DescriptionIntToHex 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.
      

  4.   

    另外怎样把用户输的十六制转成十进制????????????????????????
    例如: 用户在  edit 控件输入了 FA 的十六进制数,如何转成十进制????????????
      

  5.   

    用户在  edit 控件输入了 FA 的十六进制数,转成十进制
    就这样
    i := StrToInt('$'+Edit1.text);