Sign in Join
FPDoc Onlineexperiment

FpGetEnv function

In unit BaseUnix

Return value of environment variable.

Declaration

pascal
function FpGetEnv(name: PAnsiChar): PAnsiChar

Description

FPGetEnv returns the value of the environment variable in Name. If the variable is not defined, nil is returned. The value of the environment variable may be the empty string. A PChar is returned to accommodate for strings longer than 255 bytes, TERMCAP and LS_COLORS, for instance.

Errors

None.

Example: ex41

pascal
Program Example41;

{ Program to demonstrate the GetEnv function. }

Uses BaseUnix;

begin
  Writeln ('Path is : ',fpGetenv('PATH'));
end.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.