RECORD (IBM extension)

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.

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

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

  • For further information on record structures and derived types, see Derived types


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us