[BACK]Return to ts_filescan.adb CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / System

File: [local] / OpenXM_contrib / PHC / Ada / System / ts_filescan.adb (download)

Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:34 2000 UTC (23 years, 6 months ago) by maekawa
Branch: PHC, MAIN
CVS Tags: v2, maekawa-ipv6, RELEASE_1_2_3, RELEASE_1_2_2_KNOPPIX_b, RELEASE_1_2_2_KNOPPIX, RELEASE_1_2_2, RELEASE_1_2_1, HEAD
Changes since 1.1: +0 -0 lines

Import the second public release of PHCpack.

OKed by Jan Verschelde.

with text_io;                            use text_io;
with Communications_with_User;           use Communications_with_User;
with File_Scanning;                      use File_Scanning;

procedure ts_filescan is

-- DESCRIPTION :
--   Reads a file name and a banner, and scans for it.

  procedure Main is

    file : file_type;
    ans : character;
 
  begin
    new_line;
    put_line("Interactive test of file scanning.");
    new_line;
    loop
      put_line("Reading the name of the input file.");
      Read_Name_and_Open_File(file);
      loop
        put_line("Reading a banner.");
        declare
          banner : constant String := Read_String;
          found : boolean := false;
        begin
          Scan(file,banner,found);
          if found
           then put_line("The banner has been found.");
           else put_line("The banner has not been found.");
          end if; 
        end;
        put("Do you want to test more banners ? (y/n) ");
        Ask_Yes_or_No(ans);
        exit when (ans /= 'y');
        Reset(file);
      end loop;
      Close(file);
      put("Do you want to scan other files ? (y/n) ");
      Ask_Yes_or_No(ans);
      exit when (ans /= 'y');
    end loop;
  end Main;

begin
  Main;
end ts_filescan;