|
VMS Help ADA, Language Topics, INDEXED_IO, READ *Conan The Librarian |
procedure READ (FILE : in FILE_TYPE; ITEM : out ELEMENT_TYPE);
generic
type KEY_TYPE is private;
DEFAULT_KEY_NUMBER : INTEGER := 0;
procedure READ_BY_KEY(FILE : in FILE_TYPE;
ITEM : out ELEMENT_TYPE;
KEY : in KEY_TYPE;
KEY_NUMBER : in INTEGER :=
DEFAULT_KEY_NUMBER;
RELATION : in RELATION_TYPE := EQUAL);
Operates on a file of mode IN_FILE or INOUT_FILE. In the case
of the first form, returns, in the parameter ITEM, the value of
the next element, according to the most recent key and relation
information. In the case of the second form, returns, in the
parameter ITEM, the value of the element specified by the given
key information; KEY gives the key value; KEY_NUMBER designates a
primary (0) or alternate key (1 to 254); and RELATION determines
the kind of match to be made for the key value. For both forms,
the element read becomes the current element. In the case of the
first form, the next sequential element becomes the next element,
according to the most recent key and relation information. In
the case of the second form, the next sequential element becomes
the next element. If neither the key nor the relation information
changes from one READ_BY_KEY operation to the next, the same
element will continue to be read.
The exception MODE_ERROR is raised if the current mode is OUT_
FILE. The exception END_ERROR is raised if an attempt is made to
read past the end of the file by the first form. The exception
LOCK_ERROR is raised if the element to be read is locked; this
error is possible only if the external file is being shared.
The exception EXISTENCE_ERROR is raised if the element does not
exist. The exception KEY_ERROR is raised if the size of the given
key is not a multiple of eight bits.
|
|