Name: String;
The Name property determines a name of the custom method.
The method is shown in the modeling container and time series database under this name.
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 function named PiDiv Function is added to the custom methods collection.
See also: