procedure TForm1.Button4Click(Sender: TObject);
var L1,L2:TList;
I,K:Integer;
begin
L1:=TList.Create;
L2:=TList.Create;
for I:=1 to 20do
L1.Add(Pointer(I));
Randomize;
for I:=1 to 5do
begin
K:=Random(L1.Count-1);
L2.Add(L1[K]);
L1.Delete(K);
end;
for I:=0 to 4do
ShowMessage(IntToStr(Integer(L2)));
L1.Free;
L2.Free;
end;