XL Fortran for AIX 8.1

Language Reference

Derived Type

Purpose

The Derived Type statement is the first statement of a derived-type definition.

Format



>>-TYPE--+------------------------+--type_name-----------------><
         '-+----------------+--::-'
           '-,--access_spec-'
 
 

access_spec
is either PRIVATE or PUBLIC

type_name
is the name of the derived type

Rules

access_spec can only be specified if the derived-type definition is within the specification part of a module.

type_name cannot be the same as the name of any intrinsic type, except BYTE, or the name of any other accessible derived type.

If a label is specified on the Derived Type statement, the label belongs to the scoping unit of the derived-type definition.

If the corresponding END TYPE statement specifies a name, it must be the same as type_name.

Examples

MODULE ABC
  TYPE, PRIVATE :: SYSTEM      ! Derived type SYSTEM can only be accessed
    SEQUENCE                   !   within module ABC
    REAL :: PRIMARY
    REAL :: SECONDARY
    CHARACTER(20), DIMENSION(5) :: STAFF
  END TYPE
END MODULE

Related Information


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]