SRL Archive - Help and Support

Problem...


n3ss3s

2007-05-12 03:00:42

Well, I was making few functions for my autofighter and faced a problem : is it possible for the script to modify params? Like for example if I would like to have like (var m1,m2,m3:TPoint); but i would like there be Instances of m as countcolor's result? Im trying to mess with something like setarraylength… but if u got ideas plz post.


[Advert]Plz go see my why does this… thread[/Advert]

Markus

2007-05-14 14:17:58

What do you mean?
That you can have a variable amount of TPoints as a argument (like sometimes one, sometimes 4)?

bullzeye95

2007-05-14 15:54:19

You mean something like this?
function YourFunction(M: Array of TPoint): Integer;
begin
Result:= GetArrayLength(M);//returns the amount of params. Useless
//your coding here
end;
So you'd have to use it like YourFunction([point1, point2]);

n3ss3s

2007-05-15 12:26:52

Markus, yup thats like the thing. That if GetColor returns 3 then the function has 3 arguments of TPoints?