separate (Tracker.Activity_Pkg)

procedure Ac_Set_Up is
    ------------------------------------------------------------------------------
    --|
    --|  NAME:  AC_SET_UP
    --|
    --|  OVERVIEW:
    --|    This procedure is only called if there is an existing input file.
    --|    The activity record is read from the input file by calling AC_READ.
    --|    Each record is added to the linked list by calling the generic List_Pkg
    --|    procedure ADD until there are no more activity records.
    --|
    --|  EXCEPTIONS HANDLED:
    --|    others  Error reading the record from the file.
    --|    .  This exception raises ERROR_IN_INPUT_FILE.
    --|
    --|  HISTORY:
    --|    written by   May Lee   March 1985
    --|
    --|  NOTES:
    --|    The number of activities records read in is determined by the
    --|    global variable num_of_activities.
    --|
    --|    If an error is detected reading the data, the rest of the input line
    --|    is skipped and reading the rest of the data continues.  All errors
    --|    found are reported.  Execution is not terminated until the entire
    --|    input file has been read.
    --|
    ------------------------------------------------------------------------------
    Ac_Record : Activity_Pointer;
    Ac_Num : Integer := 1;       -- number of current activity
    Bad_Data : Boolean := False;

    procedure Ac_Read is separate;

begin
    for I in 1 .. Num_Of_Activities loop
        begin
            Ac_Num := I;
            -- create a null activity record
            Ac_Record := new Activity_Type;
            --   read the activity from the file
            Ac_Read;
            --   add it to the linked list
            Add (Ac_List, Ac_Record.Name, Ac_Record);
        exception
            when others =>
                Skip_Line (Tracker_File);
                Put (" Error reading activity record ");
                Put (Ac_Num, 1);
                Put (" from the tracker file. ");
                New_Line;
                Bad_Data := True;
        end;
    end loop;

    if Bad_Data then
        raise Error_In_Input_File;
    end if;
end Ac_Set_Up;
