[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
XPsetEnv()
Replace or Insert a new environment variable
------------------------------------------------------------------------------
Function: XPsetEnv()
This function is the logical complement of the
GetEnv() (and XPreadEnv()) functions, as it allows
the user to adapt some environmental variable.
Any changes made to the environment will not be
reflected in the application's current environment,
so they will not be visible with Clipper's GetEnv().
XPreadEnv(), however, reads from the ORIGINAL copy
of the environment strings, and thus correctly
shows the eventual changes made.
Settings done with XPsetEnv() will be visible for
applications started with Clipper's RUN command,
but also when the application QUITs, so do restore
the original Variables when done.
Syntax: XPsetEnv(cVar,cValue)
Arguments: <cVar> is the variable one wishes to change/create,
<cValue> is the value to set. If <cVar> exists, it
is replaced.
Returns: A logical indicating the succes of the operation.
XPsetEnv() fails (and returns .f.) when there is not
enough room to hold the new string. It is not added
in that case, and the eventual exisiting <cVar> is not
removed.
Usage: XPsetEnv('PROMPT','(Shell) '+GetEnv('PROMPT'))
x = XPenvPtr(XPenvOrig())
RUN WhatEver
XPenvPtr(x)
setEnv('PROMPT',GetEnv('PROMPT'))
* - GetEnv() still holds the old Prompt setting....
* So this construction works
* (it doesn't if GetEnv() is replaced with XPreadEnv()!)
* XPenvPtr() sets the Env. Pointer to the original Block.
* XPenvOrig() returns a Pointer to the orig block.
* x si used to restore the Clipper environment strings.
See Also:
XPreadEnv()
XPenvPtr()
XPenvOrig()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson