morbak morbak - 1 year ago 122 Question

Convert a hex string into an unsigned decimal value

I want to convert an hex string into an unsigned value? How can I to do that?

Here's my code (not working):

az = ((Val("&H" & address_2_WR_data1)))

but the result is that: az=FFFFF000

Answer Source

You can use Convert.ToUInt32 to convert a hex string to an unsigned integer.

Dim address_2_WR_data1 As String = "F000F000"
Dim az As UInt32 = Convert.ToUInt32(address_2_WR_data1, 16)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download