for long:=0 to tqr.FieldCount-1 do
begin
while not tqr.eof do
  begin 
  if tqr.fields[long].asinteger=0 then
   //用什么命令可以跳出while循环,long增1进行下一个for循环
         else begin
      ary[i]:= tqr.fields[long].Asinteger;
      inc(i);
      tqr.next;
      end;
//取出一个字段的值赋予数组ary
i:=0;
tqr.First;
end;
end;谢谢,当一个字段值是0的话,用什么命令可以跳出while循环,long增1进行下一个for循环

解决方案 »

  1.   

    Break 语句!Causes the flow of control to exit a for, while, or repeat statement. UnitSystemCategoryflow control routinesprocedure Break;DescriptionThe Break procedure causes the flow of control to exit a for, while, or repeat statement and continue at the next statement following the loop statement.A call to Break must be contained in a for, while, or repeat statement, or the compiler reports an error.Note: Break does not violate the flow of control dictated by a try..finally construct. If a break occurs inside the try clause, the finally clause is entered.
      

  2.   

    我觉得不是Break,是Conntinue,
    Break是用于跳出语句快,即End后的第一条语句,
    Continue是忽略下面的语句,重新进行下次循环
      

  3.   

    Continue 可以
    break是退出这个循环
    exit是退出这个函数或过程
      

  4.   

    看错了,楼主是双重循环:用break
      

  5.   

    就是用 Break 跳出里面的循環
    如用Exit 完全跳出來了,這個函數全部退出了