Difference between revisions of "SortTPAByRow"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> procedure SortTPAByRow(var TPA: TPointArray); </source> ==Availability== SCAR Divi 3.33 > Current ==Description== Sorts a give...")
(No difference)

Revision as of 13:55, 2 April 2012

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