Hi,
Correct, a LONG is 4bytes (32 bits), perhaps you can use that for your 24bit variable. The bits is probably best handled as either an array, either of bits or bytes depending on how you need to read/write the 128bits (byte by byte or bit by bit etc). If a LONG doesn't suit your needs then you probably need to resort to an array in the case too.
/Henrik.Code:myByteArray VAR BYTE[3] 'Create an array of 3 bytes (24bits) myBitArray VAR BIT[128] 'Create an array of 128bits Counter VAR BYTE ' Set all three bytes in the byteArray to $55 For Counter = 0 to 3 myByteArray[Counter] = $55 NEXT ' Set all bits in the bitArray to '1' FOR Counter = 0 to 127 myBitArray[Counter] = 1 NEXT 'Copy the first 16 bits in the bitArray to the byteArray, starting at the second byte. FOR Counter = 0 to 15 myByteArray.0[Counter+7] = myBitArray[Counter] NEXT




Bookmarks