Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 1.45 KB

TPJEnvVarsEnum.md

File metadata and controls

33 lines (21 loc) · 1.45 KB

TPJEnvVarsEnum method type

Project: Environment Variables Unit

Unit: PJEnvVars

Applies to: ~>3.0

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

Description

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.

Parameters:

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