Skip to content

Latest commit

 

History

History
28 lines (16 loc) · 1.33 KB

TPJEnvVars-EnumNames.md

File metadata and controls

28 lines (16 loc) · 1.33 KB

EnumNames method

Project: Environment Variables Unit

Unit: PJEnvVars

Class: TPJEnvVars

Applies to: ~>3.0

procedure EnumNames(Callback: TPJEnvVarsEnum; Data: Pointer);

⚠️ TPJEnvVars has been deprecated. Use the TPJEnvironmentVars.EnumNames static method instead.

Description

Enumerates the names of all the environment variables in the current process.

Parameters:

  • Callback -- Method or (for Delphi 2009 or later) anonymous procedure of type TPJEnvVarsEnum that is called once for each environment variable and is passed the the environment variable's name and the value of the Data parameter.
  • Data -- Pointer passed to Callback each time it is called. The purpose of this value is user-defined and has no meaning to EnumNames.

The Callback method or (anonymous procedure) must be implemented by the caller.

Important: Environment variables should not be modified while EnumNames is executing. This is because the method takes a snap-shot of the environment variable names before it starts calling Callback. Any environment variables added or deleted while EnumNames is running will not be reflected in the enumeration and could cause obscure bugs.