Hi, a simpler way is to use generic from unit fgl.
The content of your unit listint will be:
unit listint;
{$mode ObjFPC}{$H+}
interface
uses
Classes, fgl;
type
{ TListInt }
TListInt = class(specialize TFPGList<Integer>)
public
procedure Sort;
end;
function SortProc(const Item1, Item2: Integer): integer;
implementation
function SortProc(const Item1, Item2: Integer): integer;
begin
if Item1 < Item2 then Result := -1
else if Item1 > Item2 then Result := 1
else
Result := 0;
end;
{ TListInt }
procedure TListInt.Sort;
begin
inherited Sort(@SortProc);
end;
end.
In attachment, your project with some correction in Unit1.
You can learn about generics
HERE and in this forum.