IRubricatorFormulasLookup.LookupData

Syntax

LookupData([Options: DictionaryGetDataOptions = 0]): IRubricatorFormulaData;

Parameters

Options - data getting parameter. Optional parameter. Default value - DictionaryGetDataOptions.None (getting data for reading).

Description

The LookupData method searches for a formula by specified conditions.

Example

Executing the example requires a form, a button with the Button1 name and the Memo component with the Memo1 name. Memo1 must 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 a formula is found, its key is displayed in Memo1.

See also:

IRubricatorFormulasLookup