Code :
procedure Search(T : in out Terminal_Type; name : in Name_Type; Path_Index : in out Natural; Prompt : out Name_Type; Success : out boolean) is Vector : Objects_Vector := T.Obj_Cur.vector; begin Success := False; if T.Obj_Cur.Name = Name then Prompt := Name; Success := True; else if not Is_Empty(Vector) then for I in 1..Last_Index(Vector) loop declare E : Abstracted_Access := Element(Vector, I); Term : Terminal_Type := T; begin if E /= null then Switch(Term, I, Prompt, success); Path_Index := Path_Index + 1; if Success then Search(Term, Name, Path_Index, Prompt, success); if Success then T := Term; exit; end if; end if; else raise Program_Error; end if; end; end loop; end if; end if; end Search;
|