>If you are doing serious network stuff or you import data from other
>applications, you often need to access single bits in a bit stream. I am
>aware of the binaryEn/Decode functions that are often a great help for
>this, but it would still be more xTalkish to access bits like this:
>
>  get bit 1 to 3 of myVar
>
>Comments welcome!

A "bit" chunk type sounds perfectly reasonable to me. Although I'm not sure
how a range of bits should be returned:

 Take a value of (binary) 1011 stored as a decimal 11 in myVar

bit 1: true or 1
bit 2: true or 1
bit 1 to 2: 11 (binary) or 3 (decimal) ?
bit 2 to 4: 101 (binary) or 5 (decimal) or 10 (since it's actually 1010 binary)

 Furthermore we'd have to care about big-endian vs. little-endian bits. Use
the one of the current platform, one for all stacks, or have a property to
switch ... it's not that easy.

Cheers,
-- M. Uli Kusterer

------------------------------------------------------------
             http://www.weblayout.com/witness
       'The Witnesses of TeachText are everywhere...'


Reply via email to