GETENV$

Contents


getenv$ allows you to read the value of an environment variable (updated in the shell that launched the corresponding Adonix process).

 

Syntax

   getenv$(varnam_exp)

 

Parameters

Element

Description

Restrictions

varnam_exp

Expression of the Char type that results in an environment variable name

None

 

Examples

   # What is the name of the TERM variable in the environment?
    VAR_TERM = getenv$("TERM")

 

Description and Comments

getenv$ retrieves the value of a variable given in the environment that launched Adonix in a variable of the Char type.

If the environment variable that corresponds to varnam_exp does not exist, the empty string ("") is returned without any errors. Under Windows 95 and Windows NT, if the environment variable does not exist, Adonix will look for it in the "registry."

 

Remarks

The following environment variables are tested the most often:
PATH, TMPDIR, SHELL, LOGNAME, HOME, etc.

The creation and utilization of such variables will be performed under a traditional shell, e.g., the Bourne shell, with the following operations:
VARNAM=value
VARNAM export
Adonix ....

Connected under Adonix, you will then be able to write the following in a process:
ENVVAR="VARNAM"
CH1 =
getenv$(ENVVAR)

 

Associated Errors

Error

Description

ERMODE (10)

The parameter is not of the Char type.

 

Associated Keywords

SYSTEM - DIR$ - ADXPID


CONTENTS


Copyright © Sage 1999 - 2007