LOGICAL FUNCTION SETENVVAR( LNAME, VALUE ) CHARACTER*(*), INTENT(IN ) :: LNAME CHARACTER*(*), INTENT(IN ) :: VALUE
Use C standard library function putenv()
instead.
SETENVVAR
sets the environment variable namedLNAME
toVALUE
. ReturnsTRUE
on success,FALSE
on failure (which may be caused by not being able to allocate environment space).For Fortran-90 declarations and interface checking:
USE M3UTILIOSee also environment-variable access routines
ENVGET (generic routine, I/O API-3.2 or later),
ENVDBLE,
ENVINT,
ENVREAL,
ENVSTR,
ENVYN,
ENVLIST, INTLIST, REALIST, and STRLIST; and
NAMEVAL.
LNAME
andVALUE
have length at most the current system-dependent limit. (NOTE: POSIX says that environment variables may have lengths of up to at least 256.).LNAME
does not have any embedded blanks (enviromnent variables whose names have embedded blanks are currently permitted but inaccessible under UNIX.). The current version ofSETENVVAR
does not check for this effect.
... USE M3UTILIO ... CHARACER*16 NAME CHARACTER*256 VALUE ... NAME = 'FOO' VALUE = 'Whatever value I want "FOO" to have' IF ( .NOT. SETENVVAR( NAME, VALUE ) ) THEN !! process the error: this operation failed. ... END IF ...
To: Models-3/EDSS I/O API: The Help Pages