高手帮忙解决以下!!

drift666 2004-04-10 12:36:31
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循环
...全文
14 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
Break 语句!



Causes the flow of control to exit a for, while, or repeat statement.

Unit

System

Category

flow control routines

procedure Break;

Description

The 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.
liulangnanhai 2004-04-10
  • 打赏
  • 举报
回复
就是用 Break 跳出里面的循環
如用Exit 完全跳出來了,這個函數全部退出了

xthmpro_cn 2004-04-10
  • 打赏
  • 举报
回复
看错了,楼主是双重循环:用break
myart 2004-04-10
  • 打赏
  • 举报
回复
Continue

可以
break是退出这个循环
exit是退出这个函数或过程
dbExpress 2004-04-10
  • 打赏
  • 举报
回复
用exit还不如halt好
earwig20002000 2004-04-10
  • 打赏
  • 举报
回复
用exit试试看啊
dbExpress 2004-04-10
  • 打赏
  • 举报
回复
Continue
xthmpro_cn 2004-04-10
  • 打赏
  • 举报
回复
我觉得不是Break,是Conntinue,
Break是用于跳出语句快,即End后的第一条语句,
Continue是忽略下面的语句,重新进行下次循环

2,497

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧