IRubricatorInstance.CreateFormulasLookup

Syntax

CreateFormulasLookup: IRubricatorFormulasLookup;

Description

The CreateFormulasLookup method creates an object searching for formulas.

Example

Executing the example requires a form, a button with the Button1 name and the Memo component with the Memo1 name. Memo1 should contain a formula as an XML code. The repository must contain a time series database with the OBJ_RUBRICATOR identifier that contains a formulas dictionary.

Click the button to execute the example.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

mb: IMetabase;

Rub: IMetabaseObject;

RubInst: IRubricatorInstance;

ForLoo: IRubricatorFormulasLookup;

formulaData: IRubricatorFormulaData;

Begin

mb := MetabaseClass.Active;

Rub := mb.ItemById("OBJ_RUBRICATOR").Edit;

RubInst := Rub.Open(Null) As IRubricatorInstance;

ForLoo := RubInst.CreateFormulasLookup;

ForLoo.WhereXML := Memo1.Text;

formulaData := ForLoo.LookupData;

Memo1.Clear;

If formulaData <> Null

Then Memo1.Text := Formula is found. Formula key: + formulaData.FormulaKey.ToString;

Else Memo1.Text := Formula is not found;

End If;

End Sub Button1OnClick;

After executing the example a new object is created that searches for formula in the time series database by specified XML code. If the formula is found, its key is displayed in Memo1.

See also:

IRubricatorInstance