XL Fortran for AIX 8.1

Language Reference

PARAMETER

Purpose

The PARAMETER attribute specifies names for constants.

Format



                 .-,-----------------------------.
                 V                               |
>>-PARAMETER--(----constant_name-- = --init_expr-+--)----------><
 
 

init_expr
is an initialization expression

Rules

A named constant must have its type, shape, and parameters specified in a previous specification statement in the same scoping unit or be declared implicitly. If a named constant is implicitly typed, its appearance in any subsequent type declaration statement or attribute specification statement must confirm the implied type and any parameter values.

You can define constant_name only once with a PARAMETER attribute in a scoping unit.

A named constant that is specified in the initialization expression must have been previously defined (possibly in the same PARAMETER or type declaration statement, if not in a previous statement) or made accessible through use or host association.

The initialization expression is assigned to the named constant using the rules for intrinsic assignment. If the named constant is of type character and it has inherited length, it takes on the length of the initialization expression.

Attributes Compatible with the PARAMETER Attribute


  • DIMENSION

  • PRIVATE

  • PUBLIC

Examples

REAL, PARAMETER :: TWO=2.0
 
COMPLEX      XCONST
REAL         RPART,IPART
PARAMETER    (RPART=1.1,IPART=2.2)
PARAMETER    (XCONST = (RPART,IPART+3.3))
 
CHARACTER*2, PARAMETER :: BB='   '
    
  ·
  ·
  ·
END

Related Information


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