[fpc-devel] sub byte arrays

theo xpde at theo.ch
Tue Jul 20 12:03:28 CEST 2010


Thank you Jonas.

Now I was trying if something like this would work:

TTest=(one,two,three,four);
TTestarray = {bitpacked} array [1..100000] of ttest;
PTestarray = ^TTestarray;  

var lMask: PTestarray;
begin
getmem(lMask, 25);
 lMask^[99]:=three;
 case lMask^[99] of
  one:writeln('one');
  two:writeln('two');
  three:writeln('three');
  four:writeln('four');
 end;
 freemem(lMask);
end;             


It seems, to work, but it even works with commented "bitpacked".
Shouldn't this fail? How can I test this? I have all checks on which
Lazarus IDE offers, but it's still happy.
>From what I understand, this would need 400 bytes in this scenario (not
bitpacked), isn't it?

Thank you
Theo




More information about the fpc-devel mailing list