Function
2010-02-09 19:04:12
Hey! I don't really know where to post this, so I will post it here. Anyways while developing my script I came across and little speedbump where I needed to know which, of three variables, was the smallest. So I could call Min although that limits you to 2 variables. Thus MinArr + MaxArr was born.
I don't know if this could be helpful to anyone else but personally I think it could replace, the already implemented, "Min" and "Max" functions.
Just give me some feedback, thanks. :)
function MaxArr(iArr: TIntegerArray): integer;
var
i: integer;
begin
for i := 0 to high(iArr) do
if(iArr[i] > result)then
result := iArr[i];
end;
function MinArr(iArr: TIntegerArray): integer;
var
i: integer;
begin
result := MaxArr(iArr);
for i := 0 to high(iArr) do
if(iArr[i] < result)then
result := iArr[i];
end;
I don't know if this could be helpful to anyone else but personally I think it could replace, the already implemented, "Min" and "Max" functions.
Just give me some feedback, thanks. :)