Siebel eScript Language Reference > Siebel eScript Commands > Clib Object Uncategorized Methods >
Clib.putenv() Method
This method creates an environment variable, sets the value of an existing environment variable, or removes an environment variable. Syntax
Clib.putenv(varName, stringValue)
|
|
varName |
The name of an environment variable, enclosed in quotes |
stringValue |
The value to be assigned to the environment variable, enclosed in quotes |
Returns
0 if successful; otherwise, -1. Usage
This method sets the environment variable varName to the value of stringValue. If stringValue is null, then varName is removed from the environment. The environment variable change persists only while the Siebel eScript code and its child processes are executing. After execution, a previously existing variable reverts to its pre-script value. A variable created by Clib.putenv() is destroyed automatically. Example
The following script creates an environment variable and assigns it a value. It then traces the return value to confirm that the variable was created. 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();
The script produces the following trace output. 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
See Also
Clib.getenv() Method
|