Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Tom Rettigs Library - dec(<c hex string>) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DEC(<C hex string>)
 Converts a hexadecimal number (base 16) to a decimal number (base 10).
 Returns <expN> decimal value of <hex string>.

 Returns zero if <hex string> contains an invalid character.

 DEC( "FF" ) returns 255
 DEC( "4F" ) returns  79
 DEC( "3"  ) returns   3
 DEC( "C8" ) returns 200

 DO WHILE .T.
    ACCEPT "Enter a hex number:" TO m_hex
    DO CASE
       CASE [] = m_hex
          EXIT
       CASE DEC( m_hex ) = 0 .AND. VAL(m_hex) <> 0
          ? "Error -- invalid character in hex string."
       OTHERWISE
          ? "Result: " + LTRIM(STR( DEC(m_hex) ))
    ENDCASE
 ENDDO


             Placed in the Public Domain by Tom Rettig Assoc.

See Also: BASE() BIN() HEX()

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