A boolean is one byte - which means you can get four of them into 32 bits. If you use an integer, you can get 32 values per int (32 bits) - 8 times more!Originally Posted by Androk
[pascal]procedure Test;
type
TTest = array[0..3] of Boolean;
begin
ShowMessage(IntToStr(SizeOf(TTest))); // allows 4 values
ShowMessage(IntToStr(SizeOf(Integer))); // allows 32 values
end;[/pascal]
You can either do the packing-to-integers yourself ([url=http://www.alistairkeys.co.uk/bits.shtml]]) or you can have a look at the TBits component of the VCL.
Bookmarks