Instantiate a byte array with hex values

  • Thread starter Thread starter Raterus
  • Start date Start date
R

Raterus

I'm trying to do something like this, but can't get the syntax correct, can someone help?

Dim myBytes() As Byte = {0x2b, 0x0c, 0x02, 0x87, 0x73, 0x1c, 0x00, 0x85, 0x4A}

Thanks!
 
Raterus said:
Dim myBytes() As Byte = {0x2b, 0x0c, 0x02, 0x87, 0x73,
0x1c, 0x00, 0x85, 0x4A}

\\\
Dim Bytes() As Byte = {&H2B, &HC, &H2, &H87, ...}
///

Simply replace '0x' with '&H' and remove leading zeros.
 
Back
Top