A.10.4 Specification of Line and Page Lengths
Static Semantics
The subprograms described in this subclause are concerned
with the line and page structure of a file of mode Out_File or Append_File.
They operate either on the file given as the first parameter, or, in
the absence of such a file parameter, on the current default output file.
They provide for output of text with a specified maximum line length
or page length. In these cases, line and page terminators are output
implicitly and automatically when necessary. When line and page lengths
are unbounded (that is, when they have the conventional value zero),
as in the case of a newly opened file, new lines and new pages are only
started when explicitly called for.
In all cases, the exception Status_Error is propagated
if the file to be used is not open; the exception Mode_Error is propagated
if the mode of the file is not Out_File or Append_File.
procedure Set_Line_Length(File : in File_Type; To : in Count);
procedure Set_Line_Length(To : in Count);
Sets the maximum line length of the specified
output or append file to the number of characters specified by To. The
value zero for To specifies an unbounded line length.
The exception Use_Error
is propagated if the specified line length is inappropriate for the associated
external file.
procedure Set_Page_Length(File : in File_Type; To : in Count);
procedure Set_Page_Length(To : in Count);
Sets the maximum page length of the specified
output or append file to the number of lines specified by To. The value
zero for To specifies an unbounded page length.
The exception Use_Error
is propagated if the specified page length is inappropriate for the associated
external file.
function Line_Length(File : in File_Type) return Count;
function Line_Length return Count;
Returns the maximum
line length currently set for the specified output or append file, or
zero if the line length is unbounded.
function Page_Length(File : in File_Type) return Count;
function Page_Length return Count;
Returns the maximum page length currently set
for the specified output or append file, or zero if the page length is
unbounded.
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe