Контрольная работа: Современные операционные системы и системное программирование в Delphi
end
else EditCalc. Text: =EditCalc. Text+TBitBtn(Sender). Caption;
end;
procedure TForm1. BitBtnOperationClick(Sender: TObject);
begin
LabelOperation. Caption: =TBitBtn(Sender). Caption;
Label1. Caption: =EditCalc. Text;
EditCalc. Text: ='';
Label2. Caption: =EditCalc. Text;
end;
procedure TForm1. BitBtnEqClick(Sender: TObject);
begin
v_NextOperation: =true;
if Label1. Caption=''
then Label1. Caption: ='0';
Label2. Caption: =EditCalc. Text;
if (Label2. Caption='0') and(LabelOperation. Caption [1] ='/')
then
begin
EditCalc. Text: ='??? Деление на 0';
Exit;
end;
case LabelOperation. Caption [1] of
'+': EditCalc. Text: =FloatToStr(StrToFloat(Label1. Caption) +StrToFloat(Label2. Caption));
'-': EditCalc. Text: =FloatToStr(StrToFloat(Label1. Caption) - StrToFloat(Label2. Caption));
'*': EditCalc. Text: =FloatToStr(StrToFloat(Label1. Caption) *StrToFloat(Label2. Caption));
'/': EditCalc. Text: =FloatToStr(StrToFloat(Label1. Caption) /StrToFloat(Label2. Caption));
else EditCalc. Text: ='????????????? ';
end;