package body seq_Search is procedure Sequential_Search (List : in Integer_Array; Value : in Integer; Location : out Natural) is Found : Boolean; -- Has Value been found yet? Last_Index : Natural; -- Last index in array counter : positive; begin Found := False; Last_Index := List'Last; -- is this the last stored value or the last location? counter := List'first; -- Search until element found or we're at the end of the array without finding element while (not found and counter <= last_Index) loop -- should it be < or <= if value = list(counter) then -- found what I'm looking for found := true; location := counter; -- set return value exit; -- leave loop end if; counter := counter + 1; -- get ready to look at next position end loop; if not Found then -- Set value of Location. Location := 0; end if; end Sequential_Search; end Seq_Search;