Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- RLIB 3.0a Reference - <b>function:</b> hex2dec() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function:    HEX2DEC()

Purpose:     Convert a hexadecimal string to its equivalent decimal value.

Syntax:      HEX2DEC( hex_str )

Arguments:   hex_str     - The hexadecimal value to convert to a decimal
                           value, expressed as a character string.

Returns:     The decimal value of the hexadecimal string <hex_str>

Description: This function converts hexadecimal values expressed as
             character strings to their decimal value equivalents.  There
             are many libraries that implement this function but it's nice
             to know you don't need assembly language experience to
             accomplish this task!

Notes:       The string must be a valid hexadecimal number (i.e.  contains
             only digits and letters A-F).  If a letter is encountered
             that is not in the range A-F, HEX2DEC() will calculate that
             letter as zero, and that letter will be ignored.  However,
             this may cause erroneous results.  Ensure that hex strings
             contain only valid hexadecimal characters.

             HEX2DEC() ignores case so it does not matter if the hex
             string contains lower, upper, or mixed case letters.

Example:     ? HEX2DEC("FFFF")          && result = 65535
             ? HEX2DEC("010")           && result = 16
             ? HEX2DEC("Fr0")           && result = 3840

Source:      RL_HEX2D.PRG

See also:    BIN2DEC(), DEC2HEX()

See Also: BIN2DEC() DEC2HEX()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson