Jump to content

Convert Hex to Dec problem


Recommended Posts

  • Developers

Hello?

How convert Hex to Dec if is > 2147483647 ?

thx

What are you exactly trying to do? maybe you have a snippet showing your problem?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

What are you exactly trying to do? maybe you have a snippet showing your problem?

I have txt file with numbers 15F63E6A97, 15F8D2A598, 15F8D2C199...

I need read numbers and creat loop

Dim $ds

_FileReadToArray("wo.txt",$ds)

for $i = 1 to $ds[25]

ToolTip($i,0,0)

Next

But loop do not work..((

If i write in code

$ds[25] = 0x04EE902333

for $i = 1 to $ds[25]

ToolTip($i,0,0)

Next

then i have error "Unable to parse line"

But if i write

$ds[25] = 21182292787 ; Dec("04EE902333") = 21182292787

for $i = 1 to $ds[25]

ToolTip($i,0,0)

Next

then all work good.

therefore I need convert hex to dec

Sorry for may english

Edited by MrSergey
Link to comment
Share on other sites

MsgBox(0 ,"" , Hextodec("ffff"))
Func Hextodec($hex)
    $number=0
    For $i=StringLen($hex) To 1 Step -1
        $number+=Dec(StringMid($hex,$i,1))*16^(StringLen($hex)-$i)
    Next
    Return $number
EndFunc

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

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...