From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.181.100 with SMTP id dv4mr4540774obc.47.1453492862443; Fri, 22 Jan 2016 12:01:02 -0800 (PST) X-Received: by 10.182.231.229 with SMTP id tj5mr91299obc.13.1453492862417; Fri, 22 Jan 2016 12:01:02 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.glorb.com!o2no5360784iga.0!news-out.google.com!kr2ni6247igb.0!nntp.google.com!o2no5360777iga.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 22 Jan 2016 12:01:02 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=89.234.157.254; posting-account=zd4fUAoAAABZGnAfDxrdJ5Lpts-qUilv NNTP-Posting-Host: 89.234.157.254 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Out_File , excess line From: comicfanzine@gmail.com Injection-Date: Fri, 22 Jan 2016 20:01:02 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:29201 Date: 2016-01-22T12:01:02-08:00 List-Id: 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 ;