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.

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.


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


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.