Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {МИНУС}
- procedure TForm1.Button16Click(Sender: TObject);
- BEGIN
- //minus - знак переменной, а не действие
- if (Edit1.Text='0') then
- begin
- minus:=true;
- exit;
- end else
- //короче если minus, то тупо вводишь число и всё норм
- //а потом короче такой нажимаешь любой другой знак или минус и
- //число отображаетя с минусом ну а дальше по классике
- if (pos('/', Sign)=0) and
- (pos('*', Sign)=0) and
- (pos('+', Sign)=0) and
- (pos('-', Sign)=0) then
- pustota:=Edit1.Text;
- if pustota='0' then
- begin
- Delete(pustota,length(pustota),1);
- Edit1.Text:=FloatToStr(a);
- if minus then
- begin
- A:=-(StrToFloat(Edit1.Text));
- minus:=false;
- end else
- A:=StrToFloat(Edit1.Text);
- end else
- if minus then
- begin
- A:=-(StrToFloat(Edit1.Text));
- minus:=false;
- end else
- A:=StrToFloat(Edit1.Text);
- flag:=true;
- Sign:=(Sender as TButton).Caption;
- Edit1.Text:=FloatToStr(a);
- END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement