나는 먼저 그 X 좌표에 의해 좌표 목록을 정렬하려면 다음의 Y에 의한 좌표여러 필드로 레코드 목록을 정렬하려면 어떻게합니까?
Orginal: (7,8)(10,22)(7,3)(5,10)(20,14)(7,10)(7,3)
First Step by x: (5,10)(7,8)(7,3)(7,10)(7,3)(10,22)(20,14)
Second Step by y: (5,10)(7,3)(7,3)(7,8)(7,10)(10,22)(20,14)
내가 첫 번째 단계 작동 이미 기능이 있습니다
function SortCoords(Item1: Pointer; Item2: Pointer): Integer;
var
line1 : Coords;
line2 : Coords;
begin
line1 := Coords;(Item1);
line2 := Coords;(Item2);
if (line1.X < line2.X) then
result := -1
else if (line1.X > line2.X) then
result := 1
else
result := 0;
end;
하지만를 나는 두 번째 단계를 얻지 못한다.
thx가 작동합니다. – frugi