那个qTemp问题明白了,但是这个跳出循环这个你看这样写对不对啊
For i:=0 to 100 do
begin
For j:= 0 to 100 do
begin
if i<>j then
b:=true;
else
b:=false;
break;
end;
if b:= true then
//执行代码
else
//执行代码
执行完IF...ELSE语句的代码后,还能不能接着外层循环继续啊?比如下一个I值,然后接着判断
end;
可以的,最好的方法是你亲自试一下
For i:=0 to 100 do
begin
For j:= 0 to 100 do
begin
if i<>j then
b:=true;
else
b:=false;
break; //只是跳出当前循环
end;
if b:= true then
//执行代码
else
//执行代码 //如果在这里写break的话,就可以跳出外循环
end;