help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Procedures and functions][Variables] Reference for unit 'Dos' (#rtl)

GetEnv

Get environment variable by name.

Declaration

Source position: dosh.inc line 125

function GetEnv(

  envvar: String

):String;

Description

Getenv returns the value of the environment variable EnvVar. When there is no environment variable EnvVar defined, an empty string is returned.

Remark: Under some operating systems (such as unix), case is important when looking for EnvVar.

Errors

None.

See also

EnvCount

  

Return the number of environment variables

EnvStr

  

Return environment variable by index

Example

Program Example14;
uses Dos;

{ Program to demonstrate the GetEnv function. }

begin
  WriteLn('Current PATH is ',GetEnv('PATH'));
end.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505