Hqabs jetzt danke für die Hilfe
unit Unit9;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
a,b:integer;
s:string;
x,y:char;
begin
s:= edit1.text;
a:= random (10)+1;
b:=random (10)+1;
x:=s[a];
y:=s[b];
s[a]:=y;
s[b]:=x;
edit2.text:=s;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
randomize;
edit1.text:= '';
edit2.text:='';
end;
end.