unit unter;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Buttons, StdCtrls;

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Label1: TLabel;
    Edit2: TEdit;
    Label2: TLabel;
    Button1: TButton;
    Edit3: TEdit;
    Edit4: TEdit;
    Button2: TButton;
    BitBtn1: TBitBtn;
    Edit5: TEdit;
    Edit6: TEdit;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation
   var a, b : Integer;
{$R *.DFM}

function Doppelt(a: Integer): Integer;
begin
    Doppelt := a * 2;
end;


procedure Tauschen(var x,y : Integer);
var hilf :Integer;
begin
     hilf := x;
     x := y;
     y := hilf;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
    // tauschen
    // Eingabe
    a := StrToInt(Edit1.Text);
    b := StrToInt(Edit2.Text);

    // Verarbeitung
     Tauschen(a,b);

    // Ausgabe
    Edit3.Text := IntToStr(a);
    Edit4.Text := IntToStr(b);


end;

procedure TForm1.Button2Click(Sender: TObject);
begin
    // verdoppeln
    // Eingabe
    a := StrToInt(Edit1.Text);
    b := StrToInt(Edit2.Text);

    // Verarbeitung
     a := Doppelt(a);
     b := Doppelt(b);

    // Ausgabe
    Edit5.Text := IntToStr(a);
    Edit6.Text := IntToStr(b);

end;

end.


Valid XHTML 1.0 Frameset