unit ExEx1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Button2: TButton;
    Button3: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  Text1, Text2: String;

implementation

{$R *.DFM}

procedure ExChange1 (x,y: String);
var z: String;
begin
  z := x; x := y; y := z;
end;

procedure ExChange2 (var x,y: String);
var z: String;
begin
  z := x; x := y; y := z;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Text1 := InputBox
    ('1. String','Bestätigen oder NEU','Hallo');
  Text2 := InputBox
    ('2. String','Bestätigen oder NEU','Hoppla');
  Label1.Caption := Text1;
  Label2.Caption := Text2;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  ExChange1 (Text1, Text2);
  Label1.Caption := Text1;
  Label2.Caption := Text2;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  ExChange2 (Text1, Text2);
  Label1.Caption := Text1;
  Label2.Caption := Text2;
end;

end.
 