InIntArrayEx(Array: TIntegerArray; var where: integer; number: integer): boolean;
Array is the array of integers you are inspecting
where is a variable. It tells wheter the number is found in Array[0], [1], [2] and so on.
number is the number you are looking for.
Try this, Highest=true returns the longest tpa, false returns the shortest tpa
i didn't try if it works ^^ you have a good idea there anyways!
EDIT: Added SetLength to TIA. Now it works
I tried it, works 100%.
SCAR Code:
function TPALengths(ATPA : T2DPointArray; Highest: boolean): TPointArray;
var
TIA: TIntegerArray;
i, w: integer;
begin
SetLength(TIA, Length(ATPA));
for i:= 0 to High(ATPA) do
TIA[i]:= Length(ATPA[i]);
if Highest then
InIntArrayEx(TIA, w, AMax(TIA))
else
InIntArrayEx(TIA, w, AMin(TIA));
result := ATPA[w]
end;