Jump to content
Sign in to follow this  
sd333221

Autoit doesnt turn Dec into Hex properly -_-

Recommended Posts

Autoit:

#include <string.au3>
$Dec = 123456789
$Hex = _StringToHex($Dec)
Msgbox(0, "I am too stupid to calcualte", $Hex)

Windows Calcualtor:

123456789 >> 75BCD15

Output Autoit:

313233343536373839

Output Windows Calculator:

75BCD15

:P

Share this post


Link to post
Share on other sites

Try this

#include <string.au3>
$Dec = 123456789
$Hex = _StringToHex($Dec, 8)
Msgbox(0, "I am too stupid to calcualte", $Hex)

Share this post


Link to post
Share on other sites

$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

Share this post


Link to post
Share on other sites

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

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

Uhmm thx,

are you the coder of autoit? ^^^^

You know it very well!

Nice...

Share this post


Link to post
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

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

Yesm but i dont need it reversly lol ^^

ok.... i knew that... and you already had an answer

just a way of checking... i always try to check my results reversly... i "was" great at math ... just slow due to checking like this

... still am slow too!.. ( just slower )

lol

8)


NEWHeader1.png

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...