IForeMethods.FindByKey

Syntax

FindByKey(Key: Integer): IForeMethod;

Parameters

Key is a custom method key.

Description

The FindByKey method searches the custom method in the collection by its key.

Example

Executing the example requires that the repository contains an area of the global parameters with the SHARED_P identifier.

Sub Main;

Var

mb: IMetabase;

Shp: ISharedParams;

UserMeth: IForeMethods;

uMethod: IForeMethod;

Begin

mb := MetabaseClass.Active;

Shp := mb.ItemById("SHARED_P").Bind As ISharedParams;

UserMeth := Shp.Methods;

uMethod := UserMeth.FindByKey(1);

If uMethod <> Null

Then Debug.WriteLine(uMethod.Name);

Else Debug.WriteLine("Custom method with the specified key was not found");

End If;

End Sub Main;

After executing the example the custom method with the "1" key is searched in the area of global parameters. If the method is found, its name is displayed in the console window.

See also:

IForeMethods