function GetLength- similar to Length and GetArrayLength
SCAR Code:
function GetLength(arr: TpointArray): integer;
var
i, Length : integer;
begin
for i:=0 to High(arr) do
begin
Inc(Length);
end;
result := Length;
end;
you can change (arr: TPointArray) to another variable if you arent using TPointArray, e.g: (arr: T2DPointArray).
test it:
open SCAR, paste this and click start.
SCAR Code:
program New;
var
x,y : integer;
TPA : TPointArray;
function GetLength(arr:TpointArray): integer;
var
i, Length : integer;
begin
for i:=0 to High(arr) do
begin
Inc(Length);
end;
result := Length;
end;
begin
FindColorsTolerance(TPA, 16777215, 365, 528, 365, 529, 1);
Writeln(IntToStr(GetLength(TPA)))
Writeln(IntToStr(Length(TPA)))
end.
the results will be the same.