Jump to content

Autoit doesnt turn Dec into Hex properly -_-


sd333221
 Share

Recommended Posts

$result = Hex(123456789)
MsgBox(0,"",$result)

This is what should be used to get the hex value of a number.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Uhmm thx,

are you the coder of autoit? ^^^^

You know it very well!

Nice...

No I can just read the help file and know the difference between numbers and strings :P


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Here's a revised function if you want:

$Dec = 123456789
$Hex = _revisedStringToHex($Dec)
Msgbox(0, "I am too stupid to calcualte", $Hex)

Func _revisedStringToHex($Dec)
    If $Dec < 16 Then
        Return Hex($Dec,1)
    Else
        Return _revisedStringToHex($Dec/16) & _revisedStringToHex(Mod($Dec,16))
    EndIf
EndFunc
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...