Next: GETGID, Previous: GETENV, Up: Intrinsic Procedures
GET_ENVIRONMENT_VARIABLE
— Get an environmental variableCALL GET_ENVIRONMENT_VARIABLE(NAME[, VALUE, LENGTH, STATUS, TRIM_NAME)
NAME | Shall be a scalar of type CHARACTER(1) .
|
VALUE | Shall be a scalar of type CHARACTER(1) .
|
LENGTH | Shall be a scalar of type INTEGER(4) .
|
STATUS | Shall be a scalar of type INTEGER(4) .
|
TRIM_NAME | Shall be a scalar of type LOGICAL(4) .
|
.FALSE.
, the trailing blanks in NAME
are significant; otherwise they are not part of the environment variable
name.
PROGRAM test_getenv CHARACTER(len=255) :: homedir CALL get_environment_variable("HOME", homedir) WRITE (*,*) TRIM(homedir) END PROGRAM