morbak
morbak

Reputation: 327

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

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

but the result is that: az=FFFFF000

Upvotes: 0

Views: 1317

Answers (1)

Blackwood
Blackwood

Reputation: 4534

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)

Upvotes: 1

Related Questions