Re: question on funny behaviour of binary scan

04642920123-0001_at_t-online.de
Date: 02/11/05


Date: Fri, 11 Feb 2005 18:15:08 +0100

Hi Bruce,
thanks for your answer.
I was rather fixated on scanning 8Bits of a Byte into 8 vars.
Allways loosing the remaining Bits in a Byte doesn't seem right.
The way it is makes binary scan format "B" and "b"
rather less usefull .-(

<man example>
                   binary scan \x70\x87\x05 B5B* var1 var2
             will return 2 with
01110
stored in var1 and
1000011100000101

3Byte String is 24Bit.
var1 is 5Bit
var2 is 16Bit

This would mean that after every format specifier
the "cursor" is aligned on the next _byte_ boundary.

I would prefer the _cursor_ to be stepped in conformance
with the alignment of the next format specifier.

i.e. binary scan <2bytes> BBB2H3 Bit1 Bit2 BitPair Val_12_BitWide
should work.
While whishing for the unwishable:
The ability to force scanned values to unsigned would be nice as well.

uwe