# PUTENV

Read Time: 1 minute(s)

Tags: setting environment variables environment variables

# Description

The PUTENV function is used to set environment variables for the current process. It takes the general form:

PUTENV(expression)
1

expression should evaluate to a string of the form:

EnvVarName = value
1

Where EnvVarName is the name of a valid environment variable and value is any string that makes sense for the variable being set.

If the PUTENV function succeeds it returns a boolean TRUE value, if it fails it will return a boolean FALSE value.

# Note

PUTENV only sets environment variables for the current process and processes spawned (say by EXECUTE) by this process. These variables are known as export only variables.

An example of use is as:

IF PUTENV("JBASICLOGNAME = " : UserName) THEN
    CRT "Environment configured"
END
1
2
3

See also: GETENV

Go back to jBASE BASIC

Go back to Programmers' Reference Guide