separate (Tracker.Activity_Pkg)
procedure Ac_Modify is
    ------------------------------------------------------------------------------
    --|
    --|  NAME:  AC_MODIFY
    --|
    --|  OVERVIEW:
    --|    This procedure allows the user to modify an existing record.
    --|    The user is prompted for an existing activity record by calling
    --|    the appropriate Prompt_Pkg function.  The generic FIND is used to
    --|    get the record.  The user is then allowed to change the fields by
    --|    choosing a menu selection.  The record fields are modified directly.
    --|    If the activity name is modified, MODIFY_AC_KEY is called.
    --|
    --|  EXCEPTIONS HANDLED:
    --|    none
    --|
    --|  HISTORY:
    --|    written by   May Lee   March 1985
    --|
    ------------------------------------------------------------------------------
    Abort_Proc : Boolean := False;  -- abort getting existing ac
    Activity_Name : Ac_Name_Type;      -- name of activity looking for
    Ac_Record : Activity_Pointer;
    Exit_Field_Menu : Boolean := False;  -- exit activity field menu
    Field_Selection : Integer;           -- selection from activity field menu
    Found : Boolean := False;  -- if the record was found in the list
    Key : Ac_Name_Type;      -- num of milestone looking for


    procedure Modify_Ac_Key is separate;

begin
    Put_Line ("Which activity would you like to modify?");
    Prompt_Pkg.Existing_Activ_Name (Abort_Proc, Key);

    if not Abort_Proc then
        -- set pointer to that activity, returned in ac_record
        Find (Ac_List, Key, Ac_Record, Found);

        while not Exit_Field_Menu loop
            Field_Selection := Vt100.Print_Ac_Menu (Ac_Record);

            case Field_Selection is

                when 1 =>
                    -- get activity name, change key
                    Put (" The current activity name is : ");
                    Put (Ac_Record.Name (1 .. Act_Name_Max_Len));
                    New_Line (2);
                    Put_Line
                       (" What would you like to change the activity name to? ");
                    Modify_Ac_Key;


                when 2 =>
                    -- Get percentage of total project
                    Put (" The current percentage of the total project is : ");
                    Put (Ac_Record.Percent_Tot_Proj, 3, 1, 0);
                    New_Line (2);
                    Put_Line
                       (" What would you like to change the percentage to? ");
                    Ac_Record.Percent_Tot_Proj := Prompt_Pkg.Percent;

                when 3 =>
                    -- Get priority
                    Put (" The current priority is : ");
                    Put (Ac_Record.Priority, 2);
                    New_Line (2);
                    Put_Line
                       (" What would you like to change the priority to? ");
                    Ac_Record.Priority := Prompt_Pkg.Activ_Priority;

                when 4 =>
                    -- Get consider in calculations
                    if Ac_Record.Consider_In_Calc then
                        Put (" This activity is being considered ");
                        Put ("in the tracker calculations. ");
                        New_Line (2);
                        Put_Line (" Do you still want it to be considered ? ");
                    else
                        Put (" This activity is not being considered ");
                        Put ("in the tracker calculations. ");
                        New_Line (2);
                        Put_Line (" Do you want it to be considered ? ");
                    end if;

                    Ac_Record.Consider_In_Calc :=
                       Prompt_Pkg.Consider_Ac_In_Calc;

                when 5 =>
                    -- Get percent at start
                    Put (" The current percentage at start is : ");
                    Put (Ac_Record.Percent_At_Start, 3, 1, 0);
                    New_Line (2);
                    Put_Line
                       (" What would you like to change the percentage to? ");
                    Ac_Record.Percent_At_Start := Prompt_Pkg.Percent;

                when 6 =>
                    Exit_Field_Menu := True;

                when others =>
                    Put_Line ("Please enter a number beween 1 and 6.");
            end case;
        end loop;
    end if;

end Ac_Modify;