IMsFormulaTermList.FindByTermText

Syntax

FindByTermText(Value: String): Integer;

Parameters

Value. Internal view of term.

Description

The FindByTermText method returns the index of a term in the internal presentation.

Example

Executing the example requires that the repository contains a modeling container with the CONT_MODEL identifier. This container contains a model of determinate equation with the DETERM identifier.

Add links to the Metabase and Ms system assemblies.

Sub UserProc;
Var
    ActiveMetabase: IMetabase;
    ModelCont: IMetabaseObjectDescriptor;
    Descript: IMetabaseObjectDescriptor;
    Obj: IMetabaseObject;
    Model: IMsModel;
    Transform: IMsFormulaTransform;
    Formula: IMsFormula;
    Determ: IMsDeterministicTransform;
    Operands: IMsFormulaTermList;
    Term: IMsFormulaTermInfo;
    ind: Integer;
Begin
    ActiveMetabase := MetabaseClass.Active;
    ModelCont := ActiveMetabase.ItemById("CONT_MODEL");
    Descript := ActiveMetabase.ItemByIdNamespace("DETERM", ModelCont.Key);
    Obj := Descript.Edit;
    Model := Obj As IMsModel;
    Transform := Model.Transform;
    Formula := Transform.FormulaItem(0);
    Determ := Formula.Method As IMsDeterministicTransform;
    Operands := Determ.Operands;
    Term := Determ.Result.TermInfo;
    ind := Operands.FindByTermText(Term.TermInnerText);
    If ind <> -1 Then
        Operands.Remove(ind);
        Operands.Refresh;
    End If;
    Obj.Save;
End Sub UserProc;

After executing the example the output variable is deleted from variables that can be used for making of model equation (if the output variable is present there). Then the data collection of variables is updated.

See also:

IMsFormulaTermList