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:

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.