JCL Help:GetEnvironmentVar@string@string

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Retrieves the value of an environment variable.


Pascal

 function GetEnvironmentVar(const Name: string; out Value: string): Boolean; overload;
function GetEnvironmentVar(const Name: string; out Value: string; Expand: Boolean): Boolean; overload;


Parameters

Parameters Description
const Name: string Name of the environment variable to retrieve.
out Value: string Receives the value of the specified environment variable, if it exists.
Expand: Boolean If True the returned value has the embedded environment strings expanded. If False these string are left unexpanded.


Return Value

If the function succeeds it returns True, otherwise it returns False.


Description

GetEnvironmentVar retrieves the value of the specified environment variable from the process environment block. Depending on the value of the Expand parameter, the returned string may contain environment variable strings such as %systemroot%. To expand the string, thereby replacing the strings with their system defined value, use ExpandEnvironmentVar.


See Also

DelEnvironmentVar ExpandEnvironmentVar GetEnvironmentVars SetEnvironmentVar


About

Unit

JclSysInfo


Donator

Marcel van Brakel (Win32) André Snepvangers (Unix)


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page