A sequential file can be viewed as containing "records" of data. A record of data is a block of data that has a specific format (i.e., byte-level organization). For example, a record might have a format that is as simple as a sequence of characters, or it might have a more complex format such as a sequence of data of mixed data types (e.g., "int", "char", "double"). A sequential file can be viewed as being comprised of data in records that have a specific format. The input/output operations on a sequential file operate on the data as records, not individual bytes. The data, as records, have meaning in the application, and therefore records represent an abstraction of the data in the file.
The RecordFormat property is used to capture the organization of data in a sequential file in terms of records with a specific format. This property specifies the system designer's view of the structure of the contents of a sequential file. A specification of the RecordFormat property provides users of a SeqFile component with an indication of how the data in the file should be interpreted or used.
The default value for the RecordFormat property is "line".
Subsequent specifications of the RecordFormat property in a single property list replace earlier specifications (i.e., the last specification is the one that the UniCon compiler uses).
INTERFACE IS TYPE SeqFile RECORDFORMAT ("line") PLAYER read IS ReadNext PLAYER write IS WriteNext END INTERFACEThe data type "line" in the RecordFormat property indicates that the sequential file contains records that have the structure of lines (i.e., sequences of characters terminated by a carriage return). Data streams that are read from the file should be read and interpreted as lines, and data streams written to the file should be written as lines. Below is another example:
INTERFACE IS TYPE SeqFile RECORDFORMAT ("integer", "char", "double") PLAYER read IS ReadNext PLAYER write IS WriteNext END INTERFACEIn the above RecordFormat property, the value contains three data type specifications. This means that the file contains data organized into records, where each record has three members of the given data types. Data streams are read/written from/to the file using this data record format.
Author:
Last Modified: May 12, 1996