TStrings.reverse procedure is wrong
This has been wrong for a long time...
Procedure TStrings.Reverse(aList : TStrings);
Var
I : Integer;
begin
for I:=Count-1 downto 0 do
aList.Add(Strings[i]);// if a list is self, the list grows, not reverse...
end;
What happens when you pass self?
The procedure is not a class procedure, but anyway the logic is wrong.
The function variant is OK when called as a function expecting a TStrings a result, as is a customsort. It is only the procedure that is plain wrong.
The simplest solution is:
// make it var parameter and call the function variant
procedure TStrings.Reverse(var value: Tstrings);
begin
value := value.Reverse;
end;
And won't hurt much in any case.
Edited by Thaddy de Koning