SortTPAByRow

From SCAR Divi Manual
Revision as of 16:14, 25 November 2012 by Freddy (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

procedure SortTPAByRow(var TPA: TPointArray);

Availability

SCAR Divi 3.33 > Current

Description

Sorts a given TPointArray TPA row-by-row, starting from the smallest Y coordinate to the largest Y coordinate, and for every row from the smallest X coordinate to the largest X coordinate. It does this using the fast ShellSort algorithm.

Example

var
  TPA: TPointArray;

begin
  TPA := [Point(2, 2), Point(0, 0), Point(5, 10), Point(0, 0)];
  SortTPAByRow(TPA);
  WriteLn(TPAToStr(TPA));
end.

Output:

(0,0);(0,0);(2,2);(5,10)

See Also