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.50.136.199 with SMTP id qc7mr10071151igb.13.1452466661521; Sun, 10 Jan 2016 14:57:41 -0800 (PST) X-Received: by 10.182.97.194 with SMTP id ec2mr138414obb.1.1452466661502; Sun, 10 Jan 2016 14:57:41 -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!news.glorb.com!h5no2768800igh.0!news-out.google.com!kr2ni1370igb.0!nntp.google.com!h5no2768791igh.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 10 Jan 2016 14:57:41 -0800 (PST) In-Reply-To: <77e47c8b-7dcc-4e86-8f89-1f348cdf08dd@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=178.217.187.39; posting-account=zd4fUAoAAABZGnAfDxrdJ5Lpts-qUilv NNTP-Posting-Host: 178.217.187.39 References: <77e47c8b-7dcc-4e86-8f89-1f348cdf08dd@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Re-write a file in Ada From: comicfanzine@gmail.com Injection-Date: Sun, 10 Jan 2016 22:57:41 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:29081 Date: 2016-01-10T14:57:41-08:00 List-Id: Thanks bj=F6rn lundin and the others ! I finally suceed : WITH Ada.Text_IO ; USE Ada.Text_IO ; WITH Ada.Text_IO.Unbounded_IO ; USE Ada.Text_IO.Unbounded_IO ; WITH Ada.Strings.Unbounded ; USE Ada.Strings.Unbounded ; Procedure main is next_l : Positive_Count :=3D 1 ; this_file : File_type ; f_deux : File_type ; Type T_Tableau is array( 1 .. 1_000 ) of unbounded_string ; case_of_array : T_Tableau ; get_l : integer :=3D 1 ; -- R=F4le d'intervalle dans le tableau , dans la boucle c_to_put : integer ; nb_lign_to_put : integer :=3D 1 ; Begin Open (File =3D> this_file , Mode =3D> In_file , Name =3D> "main.adb"); un : loop exit when End_Of_File ( this_file ) ; set_line ( this_file , next_l ) ; case_of_array(get_l) :=3D Get_Line( this_file ); next_l :=3D next_l + 1 ; get_l :=3D get_l + 1 ; c_to_put :=3D get_l ; -- compte le nbr de get_line effectu=E9 end loop un ; Open (File =3D> f_deux , Mode =3D> Out_file , Name =3D> "verify"); deux : loop exit when nb_lign_to_put =3D c_to_put ; Put_line( f_deux , case_of_array(nb_lign_to_put) ) ; nb_lign_to_put :=3D nb_lign_to_put + 1 ; end loop deux ; End main ;