SortTIAEx

From SCAR Divi Manual
Revision as of 14:15, 23 October 2011 by Freddy (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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