http://www.adaconcept.com/programs/keresesek_csomag.adb
package body Keresesek_Csomag is
procedure FeltetelesMaximumKeresesTombon ( T: in TombTipus; volt: out Boolean; max: out ElemTipus; maxhely: out IndexTipus ) is
maxh:IndexTipus; --a "maximalis" elem helye/indexe
begin
-- Bizonyos forditok eseten problemat okozhat
-- a hivas visszateresekor, ha nem kapott minden
-- out modu parameter erteket!
volt:= False;
if T'Length=0 then --Ha nulla hosszu a tomb, akkor ne keressunk semmit...
null; --it lehetne kivetelt dobni
else --kulonben felt. max. ker. a tanult modon...
maxh:=T'first;
for I in T'Range loop
if Feltetel(T(I)) then
if volt then if T(maxh) < T(I) then maxh := I; end if; --figyeljuk meg, hogy a "<" fv. a csomag generikus parametere
else volt:= True; maxh := I;
end if;
end if;
end loop;
max:=T(maxh);
maxhely:=maxh;
end if;
end FeltetelesMaximumKeresesTombon;
end Keresesek_csomag;