xHarbour Reference Documentation > Function Reference |
Retrieves an operating system environment variable.
GetEnv( <cEnvVar> ) --> cString
The function returns the contents of the environment variable <cEnvVar> as a character string, or a null string ("") when the environment variable does not exist.
The GetEnv() function queries the environment variables defined for the operating system command shell that has started the xHarbour application. Environment variables are defined using the SET command of the command shell.
See also: | CurDir(), CurDrive(), File(), SET DEFAULT, SET PATH |
Category: | Environment functions |
Source: | rtl\gete.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example retrieves some environment variables common for // a programming environment: PROCEDURE Main ? GetEnv( "INCLUDE" ) // SET INCLUDE=path ? GetEnv( "LIB" ) // SET LIB=path ? GetEnv( "COMSPEC" ) // Command shell RETURN
http://www.xHarbour.com