## 4.17.1 Type Declarations in Structure Declarations

The syntax of a type declaration within a record structure is identical to that of a normal Fortran type declaration statement: it includes a data type (for example, INTEGER), one or more names of variables or arrays; and optionally, one or more data initialization values.

The following rules and behavior apply to type declarations in record structures:

- %FILL can be specified in place of a field name to leave space in a record for purposes such as alignment. This creates an unnamed field.

  %FILL can have an array declarator; for example:

      INTEGER %FILL (2,2)

  Unnamed fields cannot be initialized. For example, the following statement is invalid and generates an error message:

      INTEGER %FILL /1980/

- Initial values can be supplied in field declaration statements. These initial values are supplied for all records that are declared using this structure. Fields not initialized will have undefined values when variables are declared by means of RECORD statements. Unnamed fields cannot be initialized; they are always undefined.

- Field names must always be given explicit data types. The IMPLICIT statement does not affect field declarations.

- All Fortran data types are allowed in field declarations.

- Any required array dimensions must be specified in the field declaration statements. DIMENSION statements cannot be used to define field names.

- Adjustable or assumed sized arrays and passed-length CHARACTER declarations are not allowed in field declarations.

- Field names within the same declaration level must be unique, but an inner structure declaration (substructure declaration) can include field names used in an outer structure declaration without conflict.

Previous Page Next Page Table of Contents