IForeMethod.Method

Syntax

Method: String;

Description

The Method property determines a unique identifier of the custom method.

Comments

This identifier should coincide with the identifier of the function/procedure contained in the module specified in the IForeMethod.Assembly property.

Example

Executing the example requires that the repository contains an area of the global parameters with the SHARED_P identifier. The repository should also contain the MY_FUNC_ASSEMBLY module that contains the PiDiv function.

Sub Main;

Var

mb: IMetabase;

Shp: ISharedParams;

UserMeth: IForeMethods;

uMethod: IForeMethod;

Begin

mb := MetabaseClass.Active;

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

UserMeth := Shp.Methods;

UserMeth.Clear;

uMethod := UserMeth.Add;

uMethod.Assembly := "MY_FUNC_ASSEMBLY";

uMethod.Method := "PiDiv";

uMethod.Category := "My functions";

uMethod.Name := "'PiDiv function'";

uMethod.Description := "Value is divided by 'Pi'";

uMethod.ResultType := ForeResultType.Real;

uMethod.Type := ForeMethodType.Arithmetic;

Debug.WriteLine("Method key: " + uMethod.Key.ToString);

(Shp As IMetabaseObject).Save;

End Sub Main;

After executing the example a new PiDiv function contained in the MY_FUNC_ASSEMBLY module is added to the collection of custom methods.

See also:

IForeMethod