CONTAINS

Purpose

The CONTAINS statement separates the body of a main program, external subprogram, or module subprogram from any internal subprograms that it may contain. Similarly, it separates the specification part of a module from any module subprograms.

Syntax

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

Rules

For a CONTAINS statement associated with subprograms, the following rules apply:

Examples

MODULE A
     ...
  CONTAINS               ! Module subprogram must follow
  SUBROUTINE B(X)
        ...
    CONTAINS             ! Internal subprogram must follow
    FUNCTION C(Y)
        ...
    END FUNCTION
  END SUBROUTINE
END MODULE

Related information