……
begin
for j := 0 to 7 do
begin
if j <> 0 then
begin
h := (Value shr j)and 1;
result := inttostr(h) + '_' + result ;
end
else
begin
h := (Value shr j)and 1;
result := inttostr(h);
end;
end;
end;
…… h,j都是integer;Value是Variant型的;result是string型的
begin
for j := 0 to 7 do
begin
if j <> 0 then
begin
h := (Value shr j)and 1;
result := inttostr(h) + '_' + result ;
end
else
begin
h := (Value shr j)and 1;
result := inttostr(h);
end;
end;
end;
…… h,j都是integer;Value是Variant型的;result是string型的
0_0_1_1...
好象是 Value 的值像右移j位补1的意思
if N stores the value 01101 (decimal 13), then N shl 1 returns 11010 (decimal 26)shl 向左
shr 向右
这段代码是什么意思呢?最好是把所有的代码复制完好吗?可能里面有些变量,我不清楚的,最好写完全好吗?