dimako
(dimako)
October 23, 2011, 6:59pm
1
Hi,
I am using Delphi 7 and the latest PascalScript. Here are examples showing a bug in TBits component:
var
a : TBits;
begin
a:=TBits.Create;
a.Size:=10; {Access violation at runtime}
end.
var
a : TBits;
begin
a:=TBits.Create;
a.Bits[10]:=true;
Writeln(IntToStr(a.Size)); {returns 0 instead of 11}
end.
Regards,
Dmitry.
dimako
(dimako)
October 24, 2011, 7:25pm
2
TBits is a class, not component, sorry.
Please someone let me know if this bug is Delphi7-specific. I am planning to upgrade to Delphi XE2.
Dmitry.
vovanl
(vovanl)
October 26, 2011, 9:14am
3
Hello,
Thanks, the issue was logged as #51152
As a workaround please modify uPSR_classes.pas file
procedure TBITSSIZE_R(Self: TBITS; var T: INTEGER); begin T := Self.SIZE;end;
procedure TBITSSIZE_W(Self: TBITS; T: INTEGER); begin Self.SIZE := T; end;