we should have 00 for x2
No. I did mention "Use 'xn' in the template to skip over bits you aren't interested in. ". See also pack.
The output in hex should be 0 0 3 56 79A2
So skipping the first field, and converting your expectations to decimal, the output should be:
0 3 86 31138
Which it wasn't, but will be now I've updated the code above!
Thank you for bringing my mistake to my attention. :)
In reply to Re^5: Extracting Bit Fields (Again)
by BrowserUk
in thread Extracting Bit Fields (Again)
by ozboomer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |