Use a structured record that is specialized
with the indexedRecord stereotype
to access an indexed file.
This type of file uses an
index to associate the value of a designated
field in the record with the logical position of that record in the
file.
An indexed record can be either a fixed-length or a variable-length
record. If it is a variable-length record, you must define the record
at its maximum size and specify either the
lengthItem property,
or the
numElementsItem property, or both
(see
IndexedRecord properties). You can
use EGL statements to accomplish the following tasks:
- Read
the file by using a get, get
next, or get previous statement.
- Write to the file by using an add or replace statement.
- Remove a record from the file by invoking a delete statement.
- Change the file pointer with the set record position statement.
At generation time, use a ResourceAssociation part to
specify how
you want an indexed record to be implemented for your target platform
and to provide information about how the fileName property
relates to a physical file. For more information, see the EGL Generation
Guide.
For information about properties you can assign to
an IndexedRecord
definition, see IndexedRecord properties.