Информатика. Программирование в Delphi
270
0:accum:=numb;
1:accum:=accum+numb;
2:accum:=accum-numb;
3:accum:=accum*numb;
4:accum:=accum/numb;
end;
Form1.Edit1.Text:=FloatToStr(accum);
end;
procedure TForm1.DigitBtnClick(Sender: TObject);
var
sbtn:TSpeedButton;
begin
sbtn:=Sender as TSpeedButton;
case sbtn.Tag of
1..9:
if f=0 then
begin
Edit1.Text:=IntToStr(sbtn.Tag);
f:=1;
end
else
Edit1.Text:=Edit1.Text+IntToStr(sbtn.Tag);
0:
if Edit1.Text<>'0' then
Edit1.Text:=Edit1.Text+'0';
end;
end;
procedure TForm1.OpBtnClick(Sender: TObject);
var
sbtn:TSpeedButton;
begin
sbtn:=Sender as TSpeedButton;
if f=0 then
oper:=sbtn.Tag
else
begin
DoOper;
oper:=sbtn.Tag;
f:=0;
end;
end;
I...,260,261,262,263,264,265,266,267,268,269 271,272,273,274,275,276,277,278,279,280,...370