strlst := TStringlist.create;
for i:=1 to 10 do begin
i := random(100);
if strlst.indexof(inttostr('i')) = -1 then
strlst.add(inttostr('i'))
else
while not (strlst.indexof(inttostr('i')) = -1) do
i := random(100);
end;
strlst.free;
procedure TForm1.BitBtn1Click(Sender: TObject);
const
N=100;
var
B: Array[1..N] of Boolean;
i,m,j,x:integer;
s:string;
begin
for i:=1 to N do b:=false;
m:=10;
j:=0;
Randomize;
while j<m do
begin
x:=random(N)+1;
if b[x] then continue;
inc(j);
b[x]:=true;
end;
s:='';
for i:=1 to N do
if b then s:=s+inttostr(i)+#13#10;
showmessage(s);
end;