Help with binary data: binaryDecode

david david at anon.nu
Sat Apr 12 09:04:00 EDT 2003


Been having a problem understanding the binaryDecode function. In trying to
split a header into binary bits - I can't get the right lengths...

As a test I used a 4 byte sting = 32 bits and try to slit it into 20 and 12
strings of 0's and 1's.

Problem is the second chunk only contains 8 bits not 12...

On mouseUp
    put "abcd" into testBinary
    get binaryDecode("b*", testBinary, zz)
    put zz
    answer the number of chars of zz -- = 4x8 or 32
  
    get binaryDecode("b20b12", testBinary, aa, cc)
    -- get binaryDecode("b20b*", testBinary, aa, cc)
    put aa & return & cc
    answer it
End mouseUp


Not sure what is going on - am I doing something wrong? Thought is that
"chunks" smaller than a byte are counted as a whole byte leaving the rest
for subsequent chunks...




More information about the metacard mailing list