If you're gonna do this:
you need to set the length of the array. Do this by calling set length.
For example:
SCAR Code:
var
TreeColorTPAs: T2DPointArray;
begin
SetLength(3); //set the length of the array to 3.
FindColorsSpiralTolerance(xmain, ymain, TreeColorTPAs[0], TreeColor[0], MSX1, MSY1, MSX2, MSY2, 5);
FindColorsSpiralTolerance(xmain, ymain, TreeColorTPAs[1], TreeColor[1], MSX1, MSY1, MSX2, MSY2, 5);
FindColorsSpiralTolerance(xmain, ymain, TreeColorTPAs[2], TreeColor[2], MSX1, MSY1, MSX2, MSY2, 5);