JCL Help:GetEnvironmentVars@TStrings

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Retrieves a list of all environment variables.


Pascal

 function GetEnvironmentVars(const Vars: TStrings): Boolean; overload;
function GetEnvironmentVars(const Vars: TStrings; Expand: Boolean): Boolean; overload;


Parameters

Parameters Description
const Vars: TStrings Receives the list of environment variables and their values.
Expand: Boolean If True the individual items have the embedded environment strings expanded to their system defined value before exit. If False this expansion is not done.


Return Value

If the function succeeds in retrieving the environment strings it returns True, on failure it returns False. Note that a result of True does not necessarily mean that environment string expansion was successful for all variables.


Description

GetEnvironmentVars is similar to GetEnvironmentVar except that it retrieves a list of environment variables in the process environment block and their values. If Expand is set to True any embedded environment strings, such as %systemroot% are replaced by their system defined value before exit. Use of this function is not recommended by Microsoft. Instead you should use GetEnvironmentVar to query the value of specific environment variables.


See Also

DelEnvironmentVar ExpandEnvironmentVar GetEnvironmentVar SetEnvironmentVar


About

Unit

JclSysInfo


Donator

Marcel van Brakel (Win32) Robert Rossmair (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