Difference between revisions of "TPASort"
From SCAR Divi Manual
(Created page with "==Definition== <source lang="scar" lines="false"> procedure TPASort(var TPA: TPointArray); </source> ==Availability== SCAR Divi 3.26 > Current ==Description== Sorts a given [[T...") |
(No difference)
|
Revision as of 10:52, 3 September 2011
Definition
procedure TPASort(var TPA: TPointArray);
Availability
SCAR Divi 3.26 > Current
Description
Sorts a given TPointArray TPA by distance from the origin (0, 0) using the fast ShellSort algorithm. An extended function with additional functionality is available as TPASortEx.
Example
var TPA: TPointArray; begin TPA := [Point(2, 2), Point(0, 0), Point(5, 10), Point(0, 0)]; TPASort(TPA); WriteLn('TPointArray: ' + TPAToStr(TPA)); end.
Output:
TPointArray: (0,0);(0,0);(2,2);(5,10)