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.

TPJEnvVarsEnumEx method type

Project: Environment Variables Unit

Unit: PJEnvVars

Applies to: ~>3.0

  TPJEnvVarsEnumEx =
    {$IFNDEF Supports_Closures}
    procedure(const EnvVar: TPJEnvironmentVar; Data: Pointer) of object;
    reference to procedure(const EnvVar: TPJEnvironmentVar; Data: Pointer);


TPJEnvVarsEnumEx defines the type of callback method that is called when enumerating both the names and values environment variables. Callbacks of this type are used in the TPJEnvironmentVars.EnumVars method.

If the compiler supports anonymous methods (a.k.a. closures) then the Supports_Closures symbol is defined and TPJEnvVarsEnumEx is an anonymous method. Otherwise the Supports_Closures symbol is undefined and TPJEnvVarsEnumEx is a normal method

Regardless of how TPJEnvVarsEnumEx is defined the parameters are the same.


Important: Callback methods should not add, modify or delete environment variables since this can lead to obscure bugs in the enumeration.