Jump to content
Sign in to follow this  
Dampe

Dumb question.

Recommended Posts

Dampe

how can I convert hex to a decimal?

sv5 con  rsv  ipv4 destip   port
0x05   01   00   01   8009A01B 0050

need to convert destip and port, so really it would be

80.09.A0.1B

Where the hex numbers change to decimal

thanks

Edited by Dampe

Share this post


Link to post
Share on other sites
azure

how can I convert hex to a decimal?

sv5 con  rsv  ipv4 destip   port
0x05   01   00   01   8009A01B 0050

need to convert destip and port, so really it would be

80.09.A0.1B

Where the hex numbers change to decimal

thanks

ConsoleWrite(Dec("8009A01B"))

It's in the help file :)

Share this post


Link to post
Share on other sites
azure

Oh damn,

I was looking for _HexToDec

or simular..

Thanks :)

Sloppy

$test = "8009A01B"
$i = 0
Dim $a[4]

Do
    $a[$i] = StringLeft($test,2)
    ;ConsoleWrite($a[$i]&@CRLF)
    $test = StringRight($test, StringLen($test)-2)
    $i = $i + 1
Until $i = 4

ConsoleWrite($a[0]&$a[1]&$a[2]&$a[3]&" = "&Dec($a[0])&"."&Dec($a[1])&"."&Dec($a[2])&"."&Dec($a[3])&@CRLF)

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.