SortTIAEx
From SCAR Divi Manual
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