Sign in to follow this  
Followers 0
MrSergey

Convert Hex to Dec problem

5 posts in this topic

Hello?

How convert Hex to Dec if is > 2147483647 ?

thx

Share this post


Link to post
Share on other sites



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

#3 ·  Posted (edited)

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

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

thx!!!

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  
Followers 0