FORTRAN Reference Manual

Statements
FORTRAN Reference Manual528615-001
7-80
PARAMETER Statement
°
If the first letter of name designates a logical type, exp must be a logical
expression.
If a symbolic name appears in the constant expression, it must have been
previously defined in the same or a different PARAMETER statement in the same
program unit.
If the implicit data type of name is not the correct type for exp, you must specify the
type of name in a type statement or an IMPLICIT statement before you use name in
a PARAMETER statement.
If exp is a character constant that has more than one character, you must specify
the number of characters in name before using it in a PARAMETER statement.
Once you have defined a symbolic name with the PARAMETER statement, it can
only identify its corresponding constant in that program unit.
You cannot use the symbolic name of a constant in a format specification.
You cannot use the symbolic name of a constant to form part of another constant,
for example either part of a complex constant.
You cannot change the type or length of the symbolic name of a constant in
subsequent statements.
You cannot define the symbolic name of a constant more than once in a program
unit.
Examples
Numeric type:
REAL fees, student body dues
PARAMETER (fees = 207.50, student body dues = 15.33)
REAL tuition
PARAMETER (tuition = fees + student body dues)
total fees = tuition * credits
Character type:
CHARACTER title*20
PARAMETER (title = 'Engineering Report')
Logical type:
LOGICAL yes, no
PARAMETER (yes = .TRUE., no = .FALSE.)