حساب المجموع الكلي بلغة الدالفي ttc
procedure TForm9.BitBtn1Click(Sender: TObject);
var
t,x,y,z:real;
begin
//dbedit3.text:=floattostr(strtofloat(dbedit1.text)*strtofloat(dbedit2.text));
t:=0;
x:=0;
y:=0;
z:=0;
adotable2.First;
while not(adotable2.eof) do
begin
if adotable2NFV.value=strtoint(edit5.text) then
t:=t+adotable2Total.value ;
adotable2.next;
end;
if adotable2NFV.value=strtoint(edit5.text) then
begin
adotable2.Edit;
dbedit10.Text:= edit4.text;
adotable2.post;
bitbtn3.SetFocus;
end;
edit1.text:=floattostr(t);
z:=t+x+y ;
//x:=(t*0.19);
//y:=(t+x)*0.01;
//edit2.text:=floattostr(x);
//edit3.text:=floattostr(y);
//edit4.text:=floattostr(z);
adotable2.Active:=false;
adotable2.active:=true;
end;
procedure TForm9.BitBtn1Click(Sender: TObject);
var
t,x,y,z:real;
begin
//dbedit3.text:=floattostr(strtofloat(dbedit1.text)*strtofloat(dbedit2.text));
t:=0;
x:=0;
y:=0;
z:=0;
adotable2.First;
while not(adotable2.eof) do
begin
if adotable2NFV.value=strtoint(edit5.text) then
t:=t+adotable2Total.value ;
adotable2.next;
end;
if adotable2NFV.value=strtoint(edit5.text) then
begin
adotable2.Edit;
dbedit10.Text:= edit4.text;
adotable2.post;
bitbtn3.SetFocus;
end;
edit1.text:=floattostr(t);
z:=t+x+y ;
//x:=(t*0.19);
//y:=(t+x)*0.01;
//edit2.text:=floattostr(x);
//edit3.text:=floattostr(y);
//edit4.text:=floattostr(z);
adotable2.Active:=false;
adotable2.active:=true;
end;