SETENVVAR()

Fortran version:

    LOGICAL FUNCTION SETENVVAR( LNAME, VALUE )
        CHARACTER*(*), INTENT(IN   ) :: LNAME
        CHARACTER*(*), INTENT(IN   ) :: VALUE

C version:

Use C standard library function putenv() instead.

Summary:

SETENVVAR sets the environment variable named LNAME to VALUE. Returns TRUE 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 M3UTILIO
    

See 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.

Preconditions:

  1. LNAME and VALUE have length at most the current system-dependent limit. (NOTE: POSIX says that environment variables may have lengths of up to at least 256.).
  2. LNAME does not have any embedded blanks (enviromnent variables whose names have embedded blanks are currently permitted but inaccessible under UNIX.). The current version of SETENVVAR does not check for this effect.

Fortran Usage:

    ...
    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
    ...


Previous: RDSMET

Next: SMATVEC

Up: Utility Routines

To: Models-3/EDSS I/O API: The Help Pages