Convert Hex to Dec problem

Recommended Posts

Hello?

How convert Hex to Dec if is > 2147483647 ?

thx

Share on other sites

• 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?

Live for the present,
Dream of the future,
Learn from the past.

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

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

thx!!!

Create an account

Register a new account