separate (Tracker.Personnel_Pkg)

--******************************************************************************
procedure Change_Pr_In_El (Pr_Record : in Personnel_Pointer;
                           New_Initials : in Pr_Init_Type) is
    -----------------------------------------------------------------------------
    --|
    --|  NAME: CHANGE_PR_IN_EL
    --|
    --|  OVERVIEW:
    --|    This procedure is called when a person is deleted from or modified
    --|    in the personnel list.  Before either of these actions can be taken,
    --|    the element list that contains people with the same name is walked.
    --|    This list is a field of the personnel data record.
    --|    The person's initials field of each element record is reassigned
    --|    the new person.
    --|
    --|  EXCEPTIONS HANDLED:
    --|    none
    --|
    --|  HISTORY:
    --|    Written by   May Lee   March 1985
    --|
    -----------------------------------------------------------------------------

    El_Record : Element_Pointer;   -- pr element list
    End_List : Boolean;

begin
    -- change the pr number field in el_record of the person's el list
    Start_Walk (Pr_Record.Element_List);

    loop
        Walk (Pr_Record.Element_List, El_Record, End_List);
        exit when End_List;

        if El_Record.More_Than_One_Person then
            for Ac_Index in 1 .. Num_Of_Activities loop
                if El_Record.People_Initials (Ac_Index) =
                   Pr_Record.Initials then
                    El_Record.People_Initials (Ac_Index) := New_Initials;
                end if;
            end loop;
        else
            El_Record.Person_Initials := New_Initials;
        end if;
    end loop;
end Change_Pr_In_El;
