separate (Tracker.Element_Pkg)
procedure El_Add is
    -----------------------------------------------------------------------------
    --|
    --|  NAME:  EL_ADD
    --|
    --|  OVERVIEW:
    --|    This procedure sets up the record to be added to the list by
    --|    user prompt/response.  The function calls to Prompt_Pkg return
    --|    only valid existing data.  The complete record is
    --|    then added to the linked list by calling the procedure
    --|    ADD_RECORD_TO_LISTS.
    --|
    --|  EXCEPTIONS HANDLED:
    --|    none
    --|
    --|  HISTORY:
    --|    written by   May Lee   March 1985
    --|
    --|  NOTES:
    --|    The number of elements is incremented if the element has been
    --|    successfully added to all the necessary data lists.
    -----------------------------------------------------------------------------
    Abort_Proc : Boolean := False;  -- parameter to key prompts
    A_Char : Character := ' ';  -- used for getting char input
    Count : Integer := 1;      -- used as a temp loop counter
    Ac_Index : Integer := 1;      -- number of the ac being referenced
    Ac_Record : Activity_Pointer;  -- pointer to ac data record
    End_List : Boolean := False;  -- indicates the end of list was detected
    El_Record : Element_Pointer;   -- pointer to el data record
    Found : Boolean := False;  -- whether or not a person was found on a list
    Ms_Key : Ms_Num_Type;       -- used to get key
    Pr_Record : Personnel_Pointer; -- pointer pr ac data record
    Pr_Key : Pr_Init_Type;      -- used to get key
    Ss_Key : Ss_Name_Type;      -- used to get key

begin
    -- create a null record
    El_Record := new Element_Type;

    New_Line;
    Put_Line (" If you would like more information on the type of data ");
    Put_Line (" to enter for any of the following questions, enter a '?'.  ");
    Put_Line (" Otherwise, enter the data requested.      ");
    New_Line (2);

    El_Record.Description := Prompt_Pkg.Ele_Description;
    El_Record.Desc_Key := Prompt_Pkg.New_Ele_Key;

    loop
        -- get ss name
        Prompt_Pkg.Existing_Subsys_Name (Abort_Proc, Ss_Key);

        if Abort_Proc then
            Put_Line (" You MUST enter an existing subsystem. ");
            Put_Line (" You cannot abort the procedure at this time. ");
        else
            El_Record.Subsystem_Name := Ss_Key;
            exit;
        end if;
    end loop;

    -- multiple people?  determines which element record to use
    loop
        -- until y or n
        Put_Line (" Will more than one person be working on this element? ");
        Put (" [y or n, <cr>=n)] : ");

        if End_Of_Line then
            Skip_Line;
            exit;
        else
            Get (A_Char);
            Skip_Line;

            if A_Char = 'Y' or A_Char = 'y' then
                -- define the element record
                Multiple_Pr_El_Record (El_Record);
                exit;
            elsif A_Char = '?' then
                Put_Line (" Please enter 'y' or 'n'. ");
                New_Line;
            else
                exit;
            end if;
        end if;
    end loop;

    -- prompt for the person or people assigned to the element
    if El_Record.More_Than_One_Person then
        Put_Line
           (" Enter the initials of the person assigned to each activity");
        Put_Line (" of this element... ");
        New_Line;
        -- prompt for the person working on each activity in the element
        Start_Walk (Ac_List);
        Ac_Index := 0;

        loop
            Walk (Ac_List, Ac_Record, End_List);
            exit when End_List;
            Ac_Index := Ac_Index + 1;
            Put (" Who is assigned to ");
            Put (Ac_Record.Name);
            Put_Line ("? ");

            loop
                Prompt_Pkg.Existing_Person_Initials (Abort_Proc, Pr_Key);
                exit when not Abort_Proc;
                Put_Line (" You cannot abort at this point!");
                Put_Line
                   (" Enter the initials of a person assigned to the project.");
            end loop;

            El_Record.People_Initials (Ac_Index) := Pr_Key;
        end loop;
    else
        -- only one person is assigned
        Put_Line (" Enter the initials of the person assigned to this element");
        New_Line;
        -- get new initials

        loop
            Prompt_Pkg.Existing_Person_Initials (Abort_Proc, Pr_Key);
            exit when not Abort_Proc;
            Put_Line (" You cannot abort at this point!");
            Put_Line
               (" Enter the initials of the person assigned to this element.");
        end loop;

        El_Record.Person_Initials := Pr_Key;
    end if;

    -- enter the milestone number
    loop
        Prompt_Pkg.Existing_Milstone_Number (Abort_Proc, Ms_Key);

        if Abort_Proc then
            Put_Line (" You MUST enter an existing milestone. ");
            Put_Line (" You cannot abort the procedure at this time. ");
        else
            El_Record.Milestone_Num := Ms_Key;
            exit;
        end if;
    end loop;

    El_Record.Priority := Prompt_Pkg.Element_Priority
                             (Default => El_Record.Milestone_Num);
    El_Record.Current_Size := Prompt_Pkg.Current_Size_Est;
    El_Record.Date_Size_Verified := Data_Pkg.Date;
    El_Record.Original_Size := Prompt_Pkg.Orig_Size_Est
                                  (Default => El_Record.Current_Size);
    El_Record.Complexity := Prompt_Pkg.Complexity_Factor;
    El_Record.Activity_Completeness := Prompt_Pkg.Activ_Completeness;

    -- add data to lists
    Add_Record_To_Lists (El_Record);

    -- increment number of elements
    Num_Of_Elements := Num_Of_Elements + 1;

end El_Add;
