comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: Out_File , excess line
Date: Sat, 30 Jan 2016 02:43:05 -0800 (PST)
Date: 2016-01-30T02:43:05-08:00	[thread overview]
Message-ID: <d1904294-4513-4763-9f13-b2e8c56aba73@googlegroups.com> (raw)
In-Reply-To: <lyio2bv1tz.fsf@pushface.org>

Am Samstag, 30. Januar 2016 10:44:26 UTC+1 schrieb Simon Wright:
> comicfanzine@gmail.com writes:

That's about what what I've pointed him to in the very first answer to his post.
Also my next posts tried to explain him the case.

There really is no second line, there only is one empty line ending in <end of line>.
 
> ARM A.10.2(3)[1] says
> 
>    For the procedure Close: If the file has the current mode Out_File or
>    Append_File, has the effect of calling New_Page, unless the current
>    page is already terminated; then outputs a file terminator.
> 
> ARM A.10.5(15)[2] says
> 
>    procedure New_Page(File : in File_Type);
>    procedure New_Page;
> 
>    Operates on a file of mode Out_File or Append_File. Outputs a line
>    terminator if the current line is not terminated, or if the current
>    page is empty (that is, if the current column and line numbers are
>    both equal to one). Then outputs a page terminator, which terminates
>    the current page. Adds one to the current page number and sets the
>    current column and line numbers to one.
> 
> So, if you open a file in Out_File mode, the current (empty) line is not
> terminated, and when you close the file and New_Page is called (or
> possibly simulated), a line terminator is added.
> 
> You would expect a page terminator (FF) to be added as well; indeed, if
> you call New_Page explicitly and then close the file GNAT does. I
> suspect that the reason GNAT doesn't do this in the case of just closing
> a file with an unterminated line is that that would be very surprising
> indeed!
> 
> See Terminate_Line in a-textio.adb.
> 
> [1] http://www.ada-auth.org/standards/12rm/html/RM-A-10-2.html#p3
> [2] http://www.ada-auth.org/standards/12rm/html/RM-A-10-5.html#p15


  reply	other threads:[~2016-01-30 10:43 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
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 [this message]
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