Difference between revisions of "SortTIAEx"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> procedure SortTIAEx(var TIA: TIntArray; const Int: Integer); </source> ==Availability== SCAR Divi 3.28 > Current ==Description...")
 
 
Line 32: Line 32:
 
[[Category:TIA Functions]]
 
[[Category:TIA Functions]]
 
[[Category:Array Functions]]
 
[[Category:Array Functions]]
 +
[[Category:Math Functions]]

Latest revision as of 20:25, 23 October 2011

Definition

procedure SortTIAEx(var TIA: TIntArray; const Int: Integer);

Availability

SCAR Divi 3.28 > Current

Description

Sorts a given TIntArray TIA by distance from a given integer Int using the fast ShellSort algorithm.

Example

var
  TIA: TIntArray;

begin
  TIA := [5, 6, 1, 7, -20, 3, 2, 4, -1, 25];
  SortTIAEx(TIA, 5);
  WriteLn(TIAToStr(TIA));
end.

Output:

5,6,4,3,7,2,1,-1,25,-20

See Also