Jump to content

Dumb question.


Dampe
 Share

Recommended Posts

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
Link to comment
Share on other sites

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