separate (Tracker.Activity_Pkg.Ac_Delete)
procedure Delete_Ss_Task_Num is
    -----------------------------------------------------------------------------
    --|
    --|  NAME: DELETE_SS_TASK_NUM
    --|
    --|  OVERVIEW:
    --|    This procedure is called when an activity is deleted from the
    --|    activity list.  When an activity is deleted, the subsystem list is
    --|    walked and the task number associated with that activity is deleted
    --|    from each subsystem's task number field array.  Since the task number
    --|    is stored as an array in a field of the subsystem, the array cell
    --|    corresponding to the number of the activity in the activity list
    --|    is deleted.  The remaining array cells are moved up one cell space.
    --|    The number of the cell to be deleted is ac_number.
    --|
    --|  EXCEPTIONS HANDLED:
    --|    none
    --|
    --|  HISTORY:
    --|    written by   May Lee   March 1985
    --|
    -----------------------------------------------------------------------------
    End_List : Boolean;
    Ss_Record : Subsystem_Pointer;

begin
    Start_Walk (Ss_List);

    loop
        Walk (Ss_List, Ss_Record, End_List);
        exit when End_List;

        if Ac_Number = Max_Num_Activities then
            -- last activity
            Ss_Record.Task_Numbers (Ac_Number) := 0;
        else
            -- delete task number from the array and move the rest up one
            Ss_Record.Task_Numbers (Ac_Number .. Max_Num_Activities - 1) :=
               Ss_Record.Task_Numbers (Ac_Number + 1 .. Max_Num_Activities);
            -- zero out last task number
            Ss_Record.Task_Numbers (Max_Num_Activities) := 0;
        end if;
    end loop;
end Delete_Ss_Task_Num;