From: comicfanzine@gmail.com
Subject: Re: Out_File , excess line
Date: Fri, 22 Jan 2016 12:01:02 -0800 (PST)
Date: 2016-01-22T12:01:02-08:00 [thread overview]
Message-ID: <d204f5ba-cbd6-4ddc-84ca-c5526a85adeb@googlegroups.com> (raw)
In-Reply-To: <ef074b1e-24f7-4501-8857-c4ed9ca74467@googlegroups.com>
I'm working with a text file .
Now , i use the package Ada.Text_IO.Unbounded_IO for text in Unbounded_Strings .
If i use the package Ada.Streams.Stream_IO , instead of Ada.Text_IO , for text handling , there is some changes to do :
Is there a Unbounded_String package for Stream_IO ?
Or a another simplier way ?
-----------------------
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 ;
Procedure count_nb_lines is
this_file , test_file : File_type ;
count : integer := 0 ;
Begin
Open
(File => this_file ,
Mode => In_file ,
Name => "count_nb_lines.adb");
loop exit when End_Of_File( this_file );
skip_line( this_file );
count := count + 1 ;
end loop ;
Open
(File => test_file ,
Mode => Out_File ,
Name => "test.adb");
declare
Type Tableau_lines_file is array( 1 .. count) of Unbounded_String;
case_array : Tableau_lines_file ;
begin
Reset( this_file );
Loop exit when End_Of_File( this_file );
for i in 1..case_array'Length loop
case_array(i) := get_line(this_file);
end loop ;
End loop;
for j in 1..case_array'Length loop
put_line( test_file , case_array(j) );
end loop;
end;
End count_nb_lines ;
next prev parent reply other threads:[~2016-01-22 20:01 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-20 1:39 Out_File , excess line comicfanzine
2016-01-20 11:23 ` AdaMagica
2016-01-20 13:31 ` comicfanzine
2016-01-20 14:03 ` comicfanzine
2016-01-20 14:26 ` Dmitry A. Kazakov
2016-01-20 17:33 ` AdaMagica
2016-01-21 4:50 ` comicfanzine
2016-01-21 10:27 ` Jacob Sparre Andersen
2016-01-21 10:56 ` AdaMagica
2016-01-21 11:57 ` G.B.
2016-01-21 14:42 ` Dmitry A. Kazakov
2016-01-21 16:23 ` AdaMagica
2016-01-22 2:50 ` Dennis Lee Bieber
2016-01-21 13:38 ` Dennis Lee Bieber
2016-01-21 17:30 ` comicfanzine
2016-01-22 1:56 ` comicfanzine
2016-01-22 12:28 ` Brian Drummond
2016-01-22 20:01 ` comicfanzine [this message]
2016-01-23 20:06 ` comicfanzine
2016-01-27 9:26 ` Simon Wright
2016-01-27 19:32 ` Simon Wright
2016-01-27 21:31 ` Jeffrey R. Carter
2016-01-27 20:28 ` Dmitry A. Kazakov
2016-01-24 16:11 ` comicfanzine
2016-01-25 21:54 ` comicfanzine
2016-01-25 22:01 ` MM
2016-01-26 0:50 ` comicfanzine
2016-01-26 10:10 ` comicfanzine
2016-01-27 3:57 ` comicfanzine
2016-01-27 8:13 ` AdaMagica
2016-01-28 4:35 ` comicfanzine
2016-01-29 23:04 ` comicfanzine
2016-01-30 9:44 ` Simon Wright
2016-01-30 10:43 ` AdaMagica
2016-01-30 13:51 ` Simon Wright
2016-01-31 8:56 ` comicfanzine
2016-01-31 11:25 ` Simon Wright
2016-01-31 12:57 ` Dmitry A. Kazakov
2016-01-31 17:00 ` Simon Wright
2016-01-31 11:51 ` AdaMagica
2016-02-01 6:22 ` comicfanzine
2016-02-01 8:32 ` Dmitry A. Kazakov
2016-02-09 15:07 ` comicfanzine
2016-02-09 17:00 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox