[2] |
|
|||
Returns | Integer / Float / <err> | |||
hexStr | String (Director or strX) hex value | |||
iRetType | Integer return type. 0: auto (integer when result <=the maxInteger) , 1: always integer, 2: always float | |||
Description |
Converts the hexadecimal director string or xStr object to a decimal number.
By default, this command will return an integer for values less than the maxInteger and a float for higher values. Passing an iRetType value forces the Xtra to return the specified type for all values. |
|||
Examples |
put _dtoh(255), _dtoh(255).htod()
-- FF 255 put _htod("FFFF") -- 65535 hexStr = _s("FFFFFFFF") --or: hexStr = _dtoh( the maxInteger *2.0 + 1) put hexStr.toDec() -- 4294967295.0000 put hexStr.toDec(1) --force the Xtra to return an integer. -- -1 --( -1 = the maxInteger * 2 + 1 , as integer) put _htod("ABCD-WW") -- pass some invalid data. -- <xErr 66613 InvalidValue> --_htod returns an error. put _h("ABCD-WW") -- -1 --unlike the _htod, _h returns a negative value on error. |
|||
Notes |
The decimal value of hexStrings larger than 8 digits is an 64bit value,
Forcing the Xtra to return integer type for such values, the result value will be: decVal mod 0xFFFFFFFF |