4. Embedded SQL for Fortran : Fortran Variables and Data Types : Variable and Type Declarations : Constant Declarations
 
Share this page                  
Constant Declarations
UNIX:
You can declare constants to the preprocessor using the Fortran parameter statement using the following syntax:
parameter (const_name = value {, const_name = value})
Note:   
The preprocessor derives the data type of const_name from the data type of value. The F77 compiler uses implicit data typing; it derives the data type of value from the first letter of const_name. Be sure that the type of the specified value is the same as the implicit type derived from const_name.
The value can be a real, integer or character literal. It cannot be an expression or a symbolic name.
The following example declaration illustrates the parameter statement:
C real constant 
    parameter (pi = 3.14159 ) 
C integer and real 
    parameter (bigint = 2147483648, bignum = 999999.99 
VMS:
You can declare constants to the preprocessor using the Fortran parameter statement using the following syntax:
parameter const_name = value {, const_name = value}
Note:   
The preprocessor and the compiler derive the data type of const_name from the data type of value. Neither the preprocessor nor the compiler make use of implicit data typing. Explicit data type declarations are not allowed in parameter statements.
The value can be a real, integer or character literal. It cannot be an expression or a symbolic name.
The following example declarations illustrate the parameter statement:
parameter (pi = 3.14159 )    real constant
parameter (bigint = 2147483648,
           bignum = 999999.99) !integer and real 
Windows:
You can declare constants to the preprocessor using the Fortran parameter statement using the following syntax:
parameter [(]const_name = value {, const_name = value}[)]
 
The preprocessor and the compiler derive the data type of const_name by an explicit type declaration statement in the same scoping unit or by the implicit typing rules in effect for the scoping unit. If the named constant is implicitly typed, it can appear in a subsequent type declaration only if that declaration confirms the implicit typing.
The value can be an expression of any data type.
The following example declarations illustrate the parameter statement:
C real constant 
    parameter pi = 3.14159  
C integer and real 
    parameter (bigint = 2147483648, bignum = 999999.99)