Welcome to the new DelphiDabbler Code Library Documentation.

This is a new site that's currently running on alpha code. There are going to be bugs. If you discover any, please report them on the site's issues page (GitHub account required). Thanks.

Warning: Many URLs are going to change. Refer to the README file to discover which library project's documentation has been completed.

GetAllNames class methods

Project: Environment Variables Unit

Unit: PJEnvVars

Class: TPJEnvironmentVars

Applies to: ~>3.0

class procedure GetAllNames(const Names: TStrings); overload;
class function GetAllNames: TStringDynArray; overload;

Description

There are two overloads of GetAllNames. Both of them get a list of the names of all environment variables in the current process and return it to the user. The overloads differ in how the names are returned.

TStrings overload

class procedure GetAllNames(const Names: TStrings); overload;

This method returns the environment variable names in the given string list.

Parameters:

TStringDynArray overload

class function GetAllNames: TStringDynArray; overload;

This form of the method returns an array of environment variable names.

Returns:

TStringDynArray is defined as array of string in Delphi 6 and later. As a convenience to Delphi 5 and earlier users, PJEnvVars defines TStringDynArray when compiled with those compilers.