SEQUENCE

Purpose

The SEQUENCE statement specifies that the order of the components in a derived-type definition establishes the storage sequence for objects of that type. Such a type becomes a sequence derived type.

Syntax

Read syntax diagramSkip visual syntax diagram>>-SEQUENCE----------------------------------------------------><
 

Rules

The SEQUENCE statement can be specified only once in a derived-type definition.

If a component of a sequence derived type is of derived type, that derived type must also be a sequence derived type.

IBM Extension

The size of a sequence derived type is equal to the number of bytes of storage needed to hold all of the components of that derived type.

End of IBM Extension

Use of sequence derived types can lead to misaligned data, which can adversely affect the performance of a program.

Examples

TYPE PERSON
  SEQUENCE
  CHARACTER*1 GENDER     ! Offset 0
  INTEGER(4) AGE         ! Offset 1
  CHARACTER(30) NAME     ! Offset 5
END TYPE PERSON

Related information