Sequential Input-Output Operations
Author: JTC1/SC22/WG9/ARG, by Randall Brukardt, ARG Editor

Contents Index Search Previous Next

# A.8.3 Sequential Input-Output Operations

#### Static Semantics

1
The operations available for sequential input and output are described in this subclause. The exception Status_Error is propagated if any of these operations is attempted for a file that is not open.
2
`procedure Read(File : in File_Type; Item : out Element_Type);`
3
Operates on a file of mode In_File. Reads an element from the given file, and returns the value of this element in the Item parameter.
4
The exception Mode_Error is propagated if the mode is not In_File. The exception End_Error is propagated if no more elements can be read from the given file. The exception Data_Error can be propagated if the element read cannot be interpreted as a value of the subtype Element_Type (see A.13, ``Exceptions in Input-Output'').
5
`procedure Write(File : in File_Type; Item : in Element_Type);`
6
Operates on a file of mode Out_File or Append_File. Writes the value of Item to the given file.
7
The exception Mode_Error is propagated if the mode is not Out_File or Append_File. The exception Use_Error is propagated if the capacity of the external file is exceeded.
8
`function End_Of_File(File : in File_Type) return Boolean;`
9
Operates on a file of mode In_File. Returns True if no more elements can be read from the given file; otherwise returns False.
10
The exception Mode_Error is propagated if the mode is not In_File.

Contents Index Search Previous Next Legal