IBM Extension

RECORD

Purpose

The RECORD statement is a special form of type declaration statement. Unlike other type declaration statements, attributes for entities declared on the RECORD statement cannot be specified on the statement itself.

Syntax

Read syntax diagramSkip visual syntax diagram           .-,------------------------------------------.
           V                                            |
>>-RECORD----/ type_name /--+----+--record_obj_dcl_list-+------><
                            '-::-'
 

record_obj_dcl:

Read syntax diagramSkip visual syntax diagram>>-record_object_name--+----------------+----------------------><
                       '-(-array_spec-)-'
 

record_stmt:

Read syntax diagramSkip visual syntax diagram           .-,------------------------------------------.
           V                                            |
>>-RECORD----/ type_name /--+----+--record_obj_dcl_list-+------><
                            '-::-'
 

record_obj_dcl:

Read syntax diagramSkip visual syntax diagram>>-record_object_name--+----------------+----------------------><
                       '-(-array_spec-)-'
 

where type_name must be the name of a derived type that is accessible in the scoping unit.

Rules

Entities can not be initialized in a RECORD statement.

A record_stmt declares an entity to be of the derived type, specified by the type_name that most immediately precedes it.

The RECORD keyword must not appear as the type_spec of an IMPLICIT or FUNCTION statement.

Fortran 2003 Standard

A derived type with the BIND attribute must not be specified in a RECORD statement.

End of Fortran 2003 Standard

Examples

In the following example, a RECORD statement is used to declare a derived type variable.

        STRUCTURE /S/
          INTEGER I
        END STRUCTURE
        STRUCTURE /DT/
          INTEGER I
        END STRUCTURE
        RECORD/DT/REC1,REC2,/S/REC3,REC4
                        

Related information

End of IBM Extension