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

Annotation of OpenXM_contrib/PHC/Ada/System/ts_filescan.adb, Revision 1.1

1.1     ! maekawa     1: with text_io;                            use text_io;
        !             2: with Communications_with_User;           use Communications_with_User;
        !             3: with File_Scanning;                      use File_Scanning;
        !             4:
        !             5: procedure ts_filescan is
        !             6:
        !             7: -- DESCRIPTION :
        !             8: --   Reads a file name and a banner, and scans for it.
        !             9:
        !            10:   procedure Main is
        !            11:
        !            12:     file : file_type;
        !            13:     ans : character;
        !            14:
        !            15:   begin
        !            16:     new_line;
        !            17:     put_line("Interactive test of file scanning.");
        !            18:     new_line;
        !            19:     loop
        !            20:       put_line("Reading the name of the input file.");
        !            21:       Read_Name_and_Open_File(file);
        !            22:       loop
        !            23:         put_line("Reading a banner.");
        !            24:         declare
        !            25:           banner : constant String := Read_String;
        !            26:           found : boolean := false;
        !            27:         begin
        !            28:           Scan(file,banner,found);
        !            29:           if found
        !            30:            then put_line("The banner has been found.");
        !            31:            else put_line("The banner has not been found.");
        !            32:           end if;
        !            33:         end;
        !            34:         put("Do you want to test more banners ? (y/n) ");
        !            35:         Ask_Yes_or_No(ans);
        !            36:         exit when (ans /= 'y');
        !            37:         Reset(file);
        !            38:       end loop;
        !            39:       Close(file);
        !            40:       put("Do you want to scan other files ? (y/n) ");
        !            41:       Ask_Yes_or_No(ans);
        !            42:       exit when (ans /= 'y');
        !            43:     end loop;
        !            44:   end Main;
        !            45:
        !            46: begin
        !            47:   Main;
        !            48: end ts_filescan;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>