Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WITH Ada.Text_IO.Unbounded_IO ; USE Ada.Text_IO.Unbounded_IO ;
- WITH Ada.Strings.Unbounded ; USE Ada.Strings.Unbounded ;
- WITH Ada.Text_IO ; USE Ada.Text_IO ;
- WITH PragmARC.Text_IO ;
- Procedure main is
- this_file , test_file : PragmARC.Text_IO.File_Handle ;
- count : integer := 0 ;
- Begin
- PragmARC.Text_IO.Set_Line_Terminator( PragmARC.Text_IO.Unix_EOL );
- PragmARC.Text_IO.Open
- (File => this_file ,
- Mode => In_file ,
- Name => "main.adb");
- loop exit when PragmARC.Text_IO.End_Of_File( this_file );
- PragmARC.Text_IO.skip_line( this_file );
- count := count + 1 ;
- end loop ;
- PragmARC.Text_IO.Create
- (File => test_file ,
- Mode => Out_File ,
- Name => "TEST/fanzine.adb");
- declare
- Type Tableau_lines_file is array( 1 .. count) of Unbounded_String;
- case_array : Tableau_lines_file ;
- begin
- PragmARC.Text_IO.Close( this_file );
- PragmARC.Text_IO.Open
- (File => this_file ,
- Mode => In_file ,
- Name => "main.adb");
- Loop exit when PragmARC.Text_IO.End_Of_File( this_file );
- for i in 1..case_array'Length loop
- case_array(i):= To_Unbounded_String( PragmARC.Text_IO.get_line( this_file ) );
- end loop ;
- End loop;
- for j in 1..case_array'Length loop
- PragmARC.Text_IO.put_line( test_file , To_String(case_array(j) ) );
- end loop;
- end;
- End main;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement