I have folowing situation :
Code: Select all
var ExpanderMode : array[8] of byte;
buf : byte;
function Test(ModuleAddress : byte) : byte;
Begin
result := TestBit(ExpanderMode[ModuleAddress],7); // work
end;
function Test1(ModuleAddress : byte) : byte;
Begin
result := ExpanderMode[ModuleAddress].7; // BUG
end;
begin
ExpanderMode[5] := $80;
//...
buf := Test(5); // work, buf = 1;
buf := Test1(5); // BUG buf = 0;
end.
Conclusion : Accessing Individual Bits in array byte variable "Simply use the dot (.) with a variable, followed by a number" don't work.
If you take a look in asm will found the diference beetwen Test and Test1 functions.
Best regards Florin Medrea.