Here is my function
SCAR Code:Function FindColorPriority(x:longint; y: longint; NumberOfColors: Integer; Tolerance: Integer; xs, ys, xe, ye: LongInt): Integer;
var
Color: array of LongInt;
Counter: Integer;
const
Color[0]:=00000; //Set these, and add more "colors" if need be
Color[1]:=00000;
Color[2]:=00000;
begin
Counter:=0
SetArrayLength(Color, NumberOfColors)
repeat
begin
if(FindColorTolerance(x, y, Color[Counter], xs, ys, xe, ye, Tolerance) then
Result:= Counter + 1;
Exit;
end else
Counter:=Counter +1;
end;
until(Counter=NumberOfColors);
begin
if(Counter=NumberOfColors) then
Result:=0
end;
end;
Right now i have the colors set as constants, which i cant do. I want that array of colors to be put in the function thing, but the amount of colors i am using is going to vary. Is there any way, i can have the script alter the format of the function based off of NumberOfColors?
Thanks on Advance




Reply With Quote



