Введение в программирование. Pascal и Delphi. Гурьянов Л.В - 175 стр.

UptoLike

174
procedure TCalcForm.BtnMinusClick(Sender: TObject);
begin
EditResult.Text:=
IntToStr(StrToInt(EditOperand1.Text)-
StrToInt(EditOperand2.Text));
OperatorLabel.Caption:='-';
ResultLabel.Caption :='=';
EditOperand1.SetFocus;
end;
procedure TCalcForm.BtnDivideClick(Sender: TObject);
begin
EditResult.Text:=
FloatToStr(StrToFloat(EditOperand1.Text)/
StrToFloat(EditOperand2.Text));
OperatorLabel.Caption:='/';
ResultLabel.Caption :='=';
EditOperand1.SetFocus;
end;
procedure TCalcForm.BtnClearClick(Sender: TObject);
begin
EditOperand1.Text :='' ;
EditOperand2.Text :='' ;
EditResult.Text :='' ;
OperatorLabel.Caption:='?';
ResultLabel.Caption :='?';
EditOperand1.SetFocus;
end;
procedure TCalcForm.BtnCloseClick(Sender: TObject);
begin
Close;
end;
procedure TCalcForm.BtnMinusClick(Sender: TObject);
begin
   EditResult.Text:=
   IntToStr(StrToInt(EditOperand1.Text)-
             StrToInt(EditOperand2.Text));
   OperatorLabel.Caption:='-';
   ResultLabel.Caption :='=';
   EditOperand1.SetFocus;
end;

procedure TCalcForm.BtnDivideClick(Sender: TObject);
begin
   EditResult.Text:=
   FloatToStr(StrToFloat(EditOperand1.Text)/
               StrToFloat(EditOperand2.Text));
   OperatorLabel.Caption:='/';
   ResultLabel.Caption :='=';
   EditOperand1.SetFocus;
end;
procedure TCalcForm.BtnClearClick(Sender: TObject);
begin
   EditOperand1.Text :='' ;
   EditOperand2.Text :='' ;
   EditResult.Text    :='' ;
   OperatorLabel.Caption:='?';
   ResultLabel.Caption :='?';
   EditOperand1.SetFocus;
end;
procedure TCalcForm.BtnCloseClick(Sender: TObject);
begin
  Close;
end;




                           174