在DELPHI中怎么操作循环语句
while not Qry_out_storage_detail.Eof do
begin
if JustifyQuantity( Qry_out_storage_detail.fieldbyname( 'goods_id ').AsString,Qry_out_storage_detail.fieldbyname( 'goods_quantity ').AsInteger) then
begin
if application.MessageBox(pchar( '当前有销售数量比库存大的数据,名称[ '+Qry_out_storage_detail.fieldbyname( 'goods_name ').asstring + '],规格[ '+Qry_out_storage_detail.fieldbyname( 'goods_specification ').asstring + '],片序[ '+Qry_out_storage_detail.fieldbyname( 'px ').asstring + '],库存数量为: '+inttostr(nCurrcount)+ ';是否继续填写? '), '系统提示 ',mb_yesno)=idno then
begin
if nCurrcount <=0 then
begin
Qry_out_storage_detail.Delete;
怎么样才能直接跳到最后一条(Qry_out_storage_detail.NEXT语句)
end;
end;
end;
if Qry_goods.Active then
Qry_goods.Close;
Qry_goods.ParamByName( 'goods_name ').AsString:=Trim(DBGD_out_storage_detail.Fields[1].AsString);
Qry_goods.ParamByName( 'goods_specification ').AsString:=Trim(DBGD_out_storage_detail.Fields[2].AsString)+ '% ';
Qry_goods.ParamByName( 'goods_place ').AsString:=Trim(DBGD_out_storage_detail.Fields[3].AsString);
Qry_goods.ParamByName( 'goods_subject ').AsString:=Trim(DBGD_out_storage_detail.Fields[0].AsString);
Qry_goods.Open;
Qry_out_storage_detail.NEXT;
END;
[解决办法]
看得累了。。。。。
才明白,你是要跳出循环。
while true do
begin
break;//跳出来了。。。。 ^_^
end;
BTW:
Qry_out_storage_detail.next下一条
Qry_out_storage_detail.last最后一条
Qry_out_storage_detail.piror上一条
Qry_out_storage_detail.first第一条
这样的操作也是可行的。只是只要一句:
Qry_out_storage_detail.last最后一条
qry_out_storage_detail.next;
[解决办法]
table.first;
for i:=0 to table.recordcount-1 do
begin
if 满足删除条件 then
table.delete;
end;