First, start new Application on Lazarus. Add TMemo and TButton components. For Button1 handler write next:
procedure TForm1.Button1Click(Sender: TObject);
var L : TStringList;
begin
L := TStringList.Create;
L.Duplicates:=dupIgnore;
L.Text:=Memo1.Text
Memo1.Text:=L.Text;
L.Free;
end;
Run project. Then write into Memo1's field next:
4
3
2
1
2
3
4
Press Button1. And you will see old
4
3
2
1
2
3
4
instead of
4
3
2
1
Why? Extremely stupid, huh?