[fpc-devel] TBits problem
andrea.mauri at unimib.it
Thu Oct 31 16:09:55 CET 2013
I am not subscribed to the fpcdevel mailing list.
Anyway I am using TBits object but I found some errors using it. Before
adding a bugreport to the bugtracker I would be sure that there is
nothing that I am doing wrong.
Below a small procedure that highlights the wrong behaviour of TBits object.
i, bsize1, bsize2: integer;
b1, b2, b3: TBits;
s1, s2, s3: string;
for i:= 0 to bsize1 - 1 do
for i:= b1.Size to bsize2 - 1 do
if not b2.Equals(b3) then
where bitstostring is a simple function as below:
function bitstostring(b:TBits): string;
for i:= 0 to b.Size - 1 do
if b[i] then
bs:= bs + '1'
bs:= bs + '0';
What I got is that b2 has set to 1 not only the bits that are 1 in b1
but also some other bits. b2 and b3 should be the same but they are not.
I tested it on Win32 using lazarus:
Lazarus 1.0.13 r42910M FPC 2.6.2 i386-win32-win32/win64
Could you please let me know if you can reproduce it or if I am doing
Dr. Andrea Mauri, PhD
Milano Chemometrics and QSAR Research Group
Department of Environmental Sciences
University of Milano-Bicocca
P.zza della Scienza, 1
20126 Milano - Italy
Tel: ++39 02 64482801
mailto:andrea.mauri at unimib.it
More information about the fpc-devel