next up previous contents
Next: Initialisation Up: Data Objects Previous: Character Declarations

 

Constants (Parameters)

Symbolic constants, oddly known as parameters in Fortran, can easily be set up either in an attributed declaration or in a PARAMETER statement (it is recommended that the attributed form be used):

    INTEGER price_of_fags            ! F77 style - not recommended
    PARAMETER (price_of_fags = 252)  ! F77 style - not recommended
    REAL, PARAMETER ::  pi = 3.14159 ! F90 style

CHARACTER constants can assume their length from the associated literal (LEN=*), they can also be declared to be fixed length:

    CHARACTER(LEN=*), PARAMETER :: son = 'bart', dad = "Homer"

Parameters should be used:

Return to corresponding overview page gif


next up previous contents
Next: Initialisation Up: Data Objects Previous: Character Declarations

©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997
Not for commercial use.