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.

TPJEnvVarsEnum method type

Project: Environment Variables Unit

Unit: PJEnvVars

Applies to: ~>3.0

  TPJEnvVarsEnum =
    {$IFNDEF Supports_Closures}
    procedure(const VarName: string; Data: Pointer) of object;
    reference to procedure(const VarName: string; Data: Pointer);


TPJEnvVarsEnum defines the type of callback method that is called when enumerating environment variable names. Callbacks of this type are used in the TPJEnvironmentVars.EnumNames and deprecated TPJEnvVars.EnumNames methods.

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

Regardless of how TPJEnvVarsEnum 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.