We can declare a byte variable like this, for hex ’88’
Dim bytes = New Byte() { &H88 }
My case, 88 is assigned to a variable, hexvalue
How to declare the byte with the variable hex value?
Dim bytes = New Byte() { &H & hexvalue }
the above throws syntax error.
&H is just for defining constants by their hex value, so &H88 is actually 136.
You can use this if you want to cast hex input to a byte ( Long and Int also support Parse, so those are viable as well ):
And you don’t even need the leading &h if you do it that way.