[fpc-devel] sub byte arrays

theo xpde at theo.ch
Tue Jul 20 00:32:45 CEST 2010


This is probably a stupid question, but I'll ask anyway ;-)

Is there any support from the compiler to create arrays of, say

type ttest=(one,two,three,four);

Afair, these states could be represented with 2 bits. 00,01,10,11

So four of these items could be represented in a byte (in an array of
ttest).

I know that these enumerations take 4 bytes by default, and this can be
reduced with {$Z1}

My queston: is there any support from the compiler to pack 4 ttest in 4
array items (using 1 byte) or do i have to fiddle with bit-shift
operations on a byte type?

Does {$BITPACKING ON} have to do with it?

Thanks and sorry.

Theo




More information about the fpc-devel mailing list