user1159415 user1159415 - 1 month ago 9
Javascript Question

Converting Javascript Bit Shift Code to

I have some data that I am scraping from a local device on my LAN. It uses javascript to format the data, but I need to perform the same formatting in Here is an abbreviated version of the javascript:

var n = 0x740900;

alert(((n >>> 8) & 0xFF) + 1);
//result is 10

n = 0x740a00;

alert(((n >>> 8) & 0xFF) + 1);
//result is 11

Essentially, I need to feed a variable (n in this case) into the calculation, and then I am returned a value.

From my research, the >>> is a zero-fill right shift operator. I've been trying to replicate it in, but the >>> operator isn't available.

Any ideas how I can replicate this in

Dim n As UInteger = &H740900
Console.WriteLine(((n >> 8) And &HFF) + 1)
'result is 10
n = &H740A00
Console.WriteLine(((n >> 8) And &HFF) + 1)
'result is 11