morbak morbak - 6 months ago 49 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


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)