XL Fortran for AIX 8.1

Language Reference

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.

Format



>>-CONTAINS----------------------------------------------------><
 
 

Rules

When a CONTAINS statement exists, at least one subprogram must follow it.

The CONTAINS statement cannot appear in a block data program unit or in an internal subprogram.

Any label of a CONTAINS statement is considered part of the main program, subprogram, or module that contains the CONTAINS statement.

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

Program Units, Procedures, and Subprograms


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