Next: , Previous: GETENV, Up: Intrinsic Procedures


6.90 GET_ENVIRONMENT_VARIABLE — Get an environmental variable

Description:
Get the VALUE of the environmental variable ENVVAR.
Standard:
F2003
Class:
Subroutine
Syntax:
CALL GET_ENVIRONMENT_VARIABLE(ENVVAR, VALUE)
Arguments:

ENVVAR Shall be of type CHARACTER(*).
VALUE Shall be of type CHARACTER(*).

Return value:
Stores the value of ENVVAR in VALUE. If VALUE is not large enough to hold the data, it is truncated. If ENVVAR is not set, VALUE will be filled with blanks.
Example:
          PROGRAM test_getenv
            CHARACTER(len=255) :: homedir
            CALL get_environment_variable("HOME", homedir)
            WRITE (*,*) TRIM(homedir)
          END PROGRAM