Sometimes you have to get the largest number out of hundreds of others. This is the simplest way to find it:
{ You can easily modify this function to accept other numerical types }
function MaxInteger(const aInt: array of Integer): Integer;
var
iI: Integer;
begin
Result := aInt[Low(aInt)];
for iI := Low(aInt) + 1 to High(aInt) do
if aInt[iI] > Result then
Result := aInt[iI];
end;
Tags: array, find, function, get, hundreds, integer, integers, largest, modify, number, simplest
Merlin’s Delphi Forge
Leave a comment