separate (Inquiry_Operations)

--  This procedure allows users to manipulate the Abstraction of the
--    File Status (internal state memory) of the package.  This
--    information is kept in the object CURRENT_FILES.
--  It can be called repeatedly, in an arbitrary order, to connect to
--    the Statistics files.

procedure Collect_Files is
    Last : Natural;
begin
    -- put options
    for Index in Statistics_File loop
        New_Line;
        Put (Statistics_File'Image (Index));
        Put (" file is ");
        Io_Package.File_Status (Current_Files (Index));
    end loop;
    New_Line;

    if Answer ("Do you wish to change file(s)?") then
        for Index in Statistics_File loop
            New_Line;
            Put (Statistics_File'Image (Index));
            Put (" file is ");
            Io_Package.File_Status (Current_Files (Index));
            if Answer (" Do you wish to change?") then
                -- if changing to a new file, close the old one
                Io_Package.Close_File (Current_Files (Index));
                Io_Package.Get_File_Name (Current_Files (Index));
                if Current_Files (Index).File_Name /= Blank_File_Name then
                    Io_Package.Open_File (Current_Files (Index));
                end if;
            end if;
        end loop;

        New_Line;   -- put options -- echo
        for Index in Statistics_File loop
            Put (Statistics_File'Image (Index));
            Put (" file is ");
            Io_Package.File_Status (Current_Files (Index));
            New_Line;
        end loop;
    end if;
exception
    when Name_Error =>
        Put_Line (Standard_Output, "*** No file by that name.");
end Collect_Files;
--*****************************************************************************