函数参考


Dec

返回一个十六进制数的十进制数值.

Dec ( "hex" [, flag ] )

参数

hex 要转换的十六进制字符串.
flag [可选参数] Defines behavior.
Can be one of the following:
  Default = string is interpretted as integer. See remarks.
  1 = string is interpretted as 32bit integer
  2 = string is interpretted as 64bit integer
  3 = string is interpretted as double

返回值

成功: 返回十进制数字.
失败: 返回值为0,并把 @error 设为 1,说明指定的十六进制数不合法或数值溢出.

注意/说明

Default behavior is that input string is treated as integer. In this case if the result is within range of 32bit integer, it's returned as 32bit integer and if not it's returned as 64bit integer. Both signed.

相关

Hex

示例/演示


Local $bDec = Dec("FFF")
MsgBox(4096, "", $bDec) ; 显示数字 65535.