[Lazarus] ComparePoints func

Alexey aaa5500 at ya.ru
Wed Jul 26 15:54:56 CEST 2017


I think LCL has many CompareNNNN funcs, but misses func for TPoint. Here 
it's comparing x/y screen coordinates

function ComparePoints(P1, P2: TPoint): integer;
begin
   if (P1.X=P2.X) and (P1.Y=P2.Y) then exit(0);
   if (P1.Y>P2.Y) then exit(1);
   if (P1.Y<P2.Y) then exit(-1);
   if (P1.X>P2.X) then exit(1) else exit(-1);
end;


-- 
Regards,
Alexey



More information about the Lazarus mailing list