put xHexToDec("F31AA9")
-- 15932073

But no limit version:

on xHexToDec(sHex)
  sHex = (sHex.string)
  nLength = sHex.char.count
  sNum = sHex.char[nLength]
  nNum = offset(sNum, "0123456789ABCDEF") - 1
  if nLength <= 1 then
    return nNum
  else
    return nNum + xHexToDec(sHex.char[1..(nLength - 1)]) * 16
  end if
end
_____
Penworks Corporation wrote:
> The major problem here is that you have an upper limit of 0xFFFFFF, not
> quite a 32-bit max, more of a 24-bit max.  If you can live with that, I'd
> say a easy converter might be:
> 
> on hexToDec hexNum
>    -- Example hex to dec
>    -- 24-bit max
>    -- Tab Julius ([EMAIL PROTECTED])
> 
>    parts =rgb(hexNum)
>    decNum =parts.red * (256 * 256)
>    decNum =decNum + (parts.green * 256)
>    decNum =decNum + parts.blue
> 
>    return(decNum)
> end
> 
> put hexToDec("F31AA9")
> -- 15932073

Good luck,

Fumio Nonaka
Phone: +81-42-397-9452
Fax: +81-42-397-9452
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
See also:http://www.F-site.org/
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to