separate (Tracker.Milestone_Pkg)
procedure Ms_Set_Up is
    -----------------------------------------------------------------------------
    --|
    --|  NAME:  MS_SET_UP
    --|
    --|  OVERVIEW:
    --|    This procedure is only called if there is an existing input file.
    --|    The milestone list is set up by reading the milestone record
    --|    from the input file by calling MS_READ, and adding it to the linked
    --|    list by calling the generic procedure ADD until there are no more
    --|    milestone 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 milestone records read in is determined by the
    --|    global variable num_of_milestones.
    --|
    --|    If an error is detected reading the data, the rest of the input line
    --|    is skipped and reading of the rest of the data continues.  All errors
    --|    found are reported.  Execution is not terminated until the entire
    --|    input file has been read.
    --|
    -----------------------------------------------------------------------------
    Ms_Num : Integer := 1;       -- number of current milestone
    Ms_Record : Milestone_Pointer;
    Bad_Data : Boolean := False;

    procedure Ms_Read is separate;

begin
    for I in 1 .. Num_Of_Milestones loop
        begin
            Ms_Num := I;
            -- create a null milestone record
            Ms_Record := new Milestone_Type;
            -- read the milestone
            Ms_Read;
            -- add it to the linked list
            Add (Ms_List, Ms_Record.Number, Ms_Record);
        exception
            when others =>
                Bad_Data := True;
                Skip_Line (Tracker_File);
                Put (" Error reading milestone ");
                Put (Ms_Num, 1);
                Put (" from the tracker file. ");
                New_Line;
        end;
    end loop;

    if Bad_Data then
        raise Error_In_Input_File;
    end if;
end Ms_Set_Up;

