求救,大牛们进来帮帮忙
delphi吧
全部回复
仅看楼主
level 1
sangdonan 楼主
invalid argument是什么问题
procedure TPayApplyHeadForm.btnAddItemClick(Sender: TObject);
{begin
inherited;
dgDetail.RowProps[dgDetail.Row].Checked := true;
end;}
var
Item : TPay_Apply_Head ;
iRow,i :Integer;
Amount :Double;
begin
Item := TPay_Apply_Head.Create;
Item.Search_Flag := 6; //查询参数对应的物料
msgbox('1111111111');
try
if CommonSearchObj(TBizObject(Item), '') then
begin
msgbox('qqqqqqq');
iRow := dgDetail.GetFirstEmptyRow;
if iRow = -1 then
begin
msgbox('uuuuuuu');
dgDetail.RowCount := dgDetail.RowCount + 1;
iRow := dgDetail.RowCount - 1;
end;
if(Item.pay_type='质保金')then
begin
msgbox('yyyyyy');
for i := 1 to dgDetail.RowCount - 1 do
begin
msgbox('eeeeeeeee');
if not dgDetail.RowProps[i].Checked then
begin
msgbox('pppppp');
Continue;
end;
if(dgDetail.CellByField2['pay_type',i]='月结款')or(dgDetail.CellByField2['pay_type',i]='预付款')
or(dgDetail.CellByField2['pay_type',i]='退货款') then
Amount:=Amount+StrToFloatDef(dgDetail.CellByField2['Pay_Amount', i], 0);
end;
Amount:=-1*Amount*strtofloatdef(BedtASSURE_PERCENTAGE.text,0)/100;
dgDetail.CellByField2['Pay_Amount',iRow] := Format('%0.2f',[Amount]);
dgDetail.CellLocked[dgDetail.GetFieldIndex('Pay_Amount'),irow]:=true;
end;
if ( (Item.pay_type='订单补差价') or (Item.pay_type='无外箱') ) then
begin
msgbox('nnnnnnnnn');
dgDetail.CellLocked[dgDetail.GetFieldIndex('item_code'),iRow]:=False;
dgDetail.Columns[dgDetail.GetFieldIndex('item_code')].ReadOnly:=False;
end;
dgDetail.CellByField2['source_id',iRow] := IntToStr(Item.Pay_Apply_Head_Id);
dgDetail.CellByField2['bill_no',iRow] := Item.Bill_No;
dgDetail.CellByField2['date_invbill',iRow] := Item.Date_Invbill;
dgDetail.CellByField2['pay_type',iRow] := Item.pay_type;
dgDetail.CellByField2['source_line_id',iRow] :=IntToStr(Item.pay_apply_line_id);
//dgDetail.CellLocked[dgDetail.GetFieldIndex('Qty_Match'),iRow] :=True;
//dgDetail.CellLocked[dgDetail.GetFieldIndex('Price_NoTax_Fact'),iRow] :=True;
dgDetail.CellLocked[dgDetail.GetFieldIndex('pay_qty'),iRow]:=true;
dgDetail.CellLocked[dgDetail.GetFieldIndex('Pay_Percent'),iRow]:=true;
dgDetail.RowProps[iRow].Checked := True;
dgDetail.CellByField2['Pay_Type_Id',iRow] := IntToStr(Item.Pay_Type_Id);
end;
finally
msgbox('mmmmmmmmmmm');
Item.Free;
end;
end;
无效参数是什么鬼,msgbox是打桩,有个按钮一按就出现invalid argument
2016年04月22日 13点04分 1
level 1
sangdonan 楼主
顶一下,本人对Delphi研究不深
2016年04月22日 13点04分 2
level 1
sangdonan 楼主
没人?
2016年04月22日 13点04分 3
level 1
sangdonan 楼主
自顶
2016年04月22日 13点04分 4
level 1
sangdonan 楼主
啦啦啦 啦啦啦 啦啦啦啦啦啦
2016年04月22日 13点04分 5
吧务
level 14
自己debug
2016年04月22日 13点04分 6
怎样debug
2016年04月22日 14点04分
@sangdonan 基础问题,看书去。
2016年04月22日 14点04分
level 8
单步调试,查一下到处是。
2016年04月23日 00点04分 7
1