Connecting Custom Functions

Custom functions and methods can be used to enhance expression capabilities due to the use of custom calculation methods. Custom functions are available for use:

Custom functions are not connected to the tools by default. They should be entered manually each time to be used. Foresight Analytics Platform enables the user to connect custom functions to system functions in all tools defined above.

NOTE. Connecting custom functions is available for the users included in the Administrators group.

For example, in the expression editor custom functions are displayed on the functions panel in the Custom Functions category:

To connect custom functions, use the Methods tab in the Custom Metadata section of the Parameters dialog box. All methods added on this tab will be connected to the custom functions section in the Foresight Analytics Platform tools.

To open the dialog box

The Methods tab contains custom functions grouped by folders. Folders are categories that are used to arrange and group functions.

Requirements to custom functions:

NOTE. A custom function should have a unique name. If after a unit or assembly is selected that contains a function, which name matches with any function or system method or function added before, an exception is thrown. The use of such a unit or assembly will be unavailable.

Add a category

Add a method

Set up method

Set up method parameters

Rename method or category

Set up method or category order

Delete method or category

Example of Custom Function Syntax

Functions and methods can be used as a custom function.

Custom method syntax:

Sub MyFunc(Factor1, Factor2: ITimeSeries; Var Output: ITimeSeries; Coef1: Double; Coef2: Double);
Begin
    ...
End Sub MyFunc;

Method parameters:

Custom function syntax:

Function MyFunc(Input, Input1: ITimeSeries; Coef: Double): ITimeSeries;
Var
    Output: ITimeSeries;
Begin
    ...
    Return Output;
End Function MyFunc;

Function parameters:

See also:

Creating Formulas and Expressions