GetEnvironmentString function
System Information routines |
![]() ![]() ![]() |
acUtils
|
function GetEnvironmentString(const St: String): String;
|
The GetEnvironmentString retrieves the string value of the specified environment variable of the Windows, from the environment block of the calling process. The St parameter identifies the variable.
|
{ returns the searching pathes (SET PATH="...") }
|
SearchPathes := GetEnvironmentString('PATH');
|
function GetEnvironmentString(const St: String): String;
|
var Len: Integer;
|
begin
|
Result := '';
|
Len := GetEnvironmentVariable(PChar(St), nil, 0);
|
if Len = 0 then Exit;
|
SetLength(Result, Len - 1);
|
GetEnvironmentVariable(PChar(St), PChar(Result), Len);
|
end;
|
SystemPathes property of the acSystemInfo component.
|