C++
virtual ACDBCORE2D_PORT const ACHAR* getEnv( const ACHAR * var );
Description
This function searches the environment of the application for the variable specified by var. Typically the search proceeds as follows until the variable is found or there is nowhere left to search:
To search the environment for the variable
- The application's internal environment is searched.
- The registry area for the program is searched.
- The DOS environment space is searched.
If the variable is found, then the value it is set to is returned as a string. If the variable is not found, then NULL is returned.
Executables that implement the object component of your application are the most likely users of this method. If AutoCAD is your host application, getEnv() gets the value of a command switch, or an environment variable, or registry entry (the search is in that order). This is the same behavior as the LISP (getenv) function. The default implementation is to return NULL. RealDWG host applications may also implement this method, but that is not required. Database code should be perfectly able to deal with getting a NULL return (the default behavior) and will just assume the variable isn't set and go on with whatever behavior that implies. Note that if you do implement this function, it is typically implemented so that the argument is case sensitive.
Parameters
Parameters | Description |
---|---|
var | Name of environment variable for which the value is desired |