Jump to content
Sign in to follow this  
MrSergey

Convert Hex to Dec problem

Recommended Posts

MrSergey

Hello?

How convert Hex to Dec if is > 2147483647 ?

thx

Share this post


Link to post
Share on other sites
Jos

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?

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
MrSergey

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

Share this post


Link to post
Share on other sites
Xand3r

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.