flag:=true;
for i:=0 to 15 do
begin
if ((i mod 2)=0) then flag:=flag and (buf[i]=$E) //???
else flag:=flag and (buf[i]=$B); //????
if not flag then break;
end;
for i:=0 to 15 do
begin
if ((i mod 2)=0) then flag:=flag and (buf[i]=$E) //???
else flag:=flag and (buf[i]=$B); //????
if not flag then break;
end;
for i:=0 to 15 do
begin
if ((i mod 2)=0) then
flag:=flag and (buf[i]=$E) //???
else
flag:=flag and (buf[i]=$B); //????
if not flag then
break;
end;
flag and (buf[i]=$E)和flag and (buf[i]=$E)都是一个表达式
返回值是布尔型的.
就象
False and True返回值是False一样
既然if not flag then
break;
那还用得着比较什么直接改成
flag:=true;
for i:=0 to 15 do
begin
if ((i mod 2)=0) then
flag:=(buf[i]=$E) //???
else
flag:=(buf[i]=$B); //????
if not flag then
break;
end;
这样就明白多了