Hi,
I am trying to sort elements in a TList using the Sort function :
function CompareInactiveWorkers(ASquare1, ASquare2 : Pointer) : integer;
begin
Result := TSquare(ASquare2).FUnemployment - TSquare(ASquare1).FUnemployment;
end;
Squares := TList.Create;
Squares.Add(TSquare.Create);
Squares.Sort(@CompareInactiveWorkers);
I get a compilation error :
Error: Incompatible type for arg no. 1: Got "<address of function(TAbstractSquare,TAbstractSquare):LongInt;Register>", expected "<procedure variable type of function(Pointer,Pointer):LongInt;Register>"