unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, TMUnit, RtColorPicker, ExtCtrls, ColorGrd,
ExtDlgs, jpeg;
type
TForm1 =
class(TForm)
Button1: TButton;
Edit1: TEdit;
Memo1: TMemo;
procedure Edit1KeyPress(Sender: TObject;
var Key: Char);
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1:TForm1;
implementation
{$R *.dfm}
function RandName(Length : Integer):
String;
var
i : Byte;
begin
randomize();
result := '
';
SetLength(Result,Length);
for i := 0
to Length
do Result[i] := Char(Random(25)+65);
end;
procedure TForm1.Edit1KeyPress(Sender: TObject;
var Key: Char);
begin
if not (key
in ['
0' .. '
9'])
then key:=#0;
end;
procedure TForm1.Button1Click(Sender: TObject);
var x:integer;
begin
x := strtoint(Edit1.Text);
Memo1.Lines.Add(RandName(x));
Memo1.Lines.Add(RandName(x));
Memo1.Lines.Add(RandName(x));
Memo1.Lines.Add(RandName(x));
Memo1.Lines.Add(RandName(x));
end;
procedure TForm1.FormShow(Sender: TObject);
begin
Edit1.Text := '
';
end;
end.