Code:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Label2: TLabel;
Label3: TLabel;
Button2: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Zahl, Zahl2, ergebnis: integer;
Zahl3: String;
n: Integer;
z: Integer;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
Repeat
if n = 10 then
Zahl := StrToInt(Edit1.Text);
Zahl2 := StrToInt(Edit2.Text);
ergebnis:=Zahl+Zahl2;
Zahl3 :=IntToStr(ergebnis);
ShowMessage(Zahl3);
if n = 20 then
Zahl := StrToInt(Edit1.Text);
Zahl2 := StrToInt(Edit2.Text);
ergebnis:=Zahl-Zahl2;
Zahl3 :=IntToStr(ergebnis);
ShowMessage(''+Zahl3);
z := 0
until z <= 1;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Label2.Caption:='+';
n := 10
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Label2.Caption:='-';
n := 20
end;
end.