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...")
 
 
Line 27: Line 27:
 
==See Also==
 
==See Also==
 
*[[SortTPA]]
 
*[[SortTPA]]
*[[SortTPAEx]]
+
*[[SortTPASpiral]]
  
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:TPA Functions]]
 
[[Category:TPA Functions]]
 
[[Category:Array Functions]]
 
[[Category:Array Functions]]

Latest revision as of 16:14, 25 November 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