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.
Project: Environment Variables Unit
Unit: PJEnvVars
Applies to: ~>3.0
type
TPJEnvVarsEnumEx =
{$IFNDEF Supports_Closures}
procedure(const EnvVar: TPJEnvironmentVar; Data: Pointer) of object;
{$ELSE}
reference to procedure(const EnvVar: TPJEnvironmentVar; Data: Pointer);
{$ENDIF}
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.
Parameters:
EnvVar – TPJEnvironmentVar record containing the name and value of the current environment variable in the enumeration.
Data - User-specified value that was passed to TPJEnvironmentVars.EnumVars. How (or if) this value is interpreted is implementation defined.
Important: Callback methods should not add, modify or delete environment variables since this can lead to obscure bugs in the enumeration.