Siebel eScript Language Reference > C Language Library Reference > Other Clib Methods >

Clib Modify Environment Variable Method


The Clib Modify Environment Variable method creates an environment variable, sets the value of an existing environment variable, or removes an environment variable. It returns one of the following values:

  • If it is successful, then it returns the following value:

    0

  • If it is not successful, then it returns negative 1.

The Clib Modify Environment Variable method does the following:

  • Sets the environment variable that the varName argument identifies to the value that the stringValue argument contains.
  • Any modification that it makes to an environment variable persists only while the Siebel eScript code and any process that this code calls is running. After this code runs, the environment variable reverts to the value it contained before this method modified this value.
  • Automatically removes any environment variable it creates after it finishes.
Format

Clib.putenv(varName, stringValue)

Table 187 describes the arguments for the Clib Modify Environment Variable method.

Table 187. Arguments for the Clib Modify Environment Variable Method
Argument
Description

varName

The name of an environment variable, enclosed in quotes.

stringValue

The value that this method assigns to the environment variable, enclosed in quotes.

If the value in the stringValue argument is null, then this method removes the environment variable that the varName argument identifies.

Example

The following example creates an environment variable and assigns a value to it. To confirm that the variable was created, it then traces the return value:

TheApplication().TraceOn("c:\\eScript_trace.txt","allocation","all");
var a = Clib.putenv("TEST","test value");
TheApplication().Trace("TEST : " + a);
TheApplication().Trace("TEST= " + Clib.getenv("TEST");
TheApplication().TraceOff();

This example produces the following result:

03/05/04,16:56:28,START,7.5.3 [16157] LANG_INDEPENDENT,SADMIN,3388,7448
03/05/04,16:56:28,COMMENT,TEST : 0
03/05/04,16:56:28,COMMENT,TEST= test value
03/05/04,16:56:28,STOP

Siebel eScript Language Reference Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.