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.107.167.148 with SMTP id q142mr27598662ioe.17.1453192988361; Tue, 19 Jan 2016 00:43:08 -0800 (PST) X-Received: by 10.182.112.202 with SMTP id is10mr327035obb.7.1453192988342; Tue, 19 Jan 2016 00:43:08 -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!o2no4370616iga.0!news-out.google.com!l1ni628igd.0!nntp.google.com!o2no4370606iga.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 19 Jan 2016 00:43:08 -0800 (PST) In-Reply-To: <687cd6fa-bf75-4892-b74e-d3ad381d8612@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=213.61.149.100; posting-account=zd4fUAoAAABZGnAfDxrdJ5Lpts-qUilv NNTP-Posting-Host: 213.61.149.100 References: <687cd6fa-bf75-4892-b74e-d3ad381d8612@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2fa0ebeb-967d-4f50-8634-2462904a920e@googlegroups.com> Subject: Re: End of a file From: comicfanzine@gmail.com Injection-Date: Tue, 19 Jan 2016 08:43:08 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:29158 Date: 2016-01-19T00:43:08-08:00 List-Id: >How many lines do you wish this call to skip on >each iteration? Edit : Sorry , i posted the wrong code . It just doesn't make sense , why the program create a extra line ? The rignt number is 25 lines . But it print 26 . WITH Ada.Text_IO ; USE Ada.Text_IO ; Procedure count_nb_lines is this_file : File_type ; count : Positive_Count := 1 ; 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 ; put ( "Total of lines by Ada.Text_IO' s package : "&Positive_Count'Image( count ) ); Close( this_file ); end count_nb_lines ;