SetEnv Function (String, String) | |
Update or replace the contents of a DOS environment variable.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax FUNCTION SetEnv(
cVar AS STRING,
cValue AS STRING
) AS LOGIC
public static bool SetEnv(
string cVar,
string cValue
)
Request Example
View SourceParameters
- cVar
- Type: String
The environment variable to be modified. - cValue
- Type: String
The new value to assign to the environment variable.
Return Value
Type:
Logic
TRUE if successful; otherwise FALSE.
Remarks
SetEnv() lets you either append or replace a DOS environment variable from within an application. Typically this is configuration information-- including path names--that describes the location of files (database, index, label, or reports).
Note: Instead of using environment variables for configuring your application, you may want to consider using registry settings.
Examples
These examples modify the DOS PATH:
1? SetEnv("PATH","D:\CAVO2x\BIN", .F.)
2? GetEnv("PATH")
3? SetEnv("PATH", "C:\MyApp", .T.)
4? GetEnv("PATH")
See Also