IAlgoObjectsParamsControl.Count

Syntax

Count: Integer;

Description

The Count property returns the number of repository objects, for which one can set up parameter control.

Example

Executing the example requires that the repository contains a calculation algorithm with the ALGORITHM identifier. The algorithm has parameters. The working area displays added repository objects, for which parameter control is set up via algorithm parameters.

Add links to the Algo, Metabase, Ms system assemblies. Add a link to the assembly required for working with calculation algorithm.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObjectDescriptor;
    Algo: ICalcObject;
    CalcAlgo: ICalcAlgorithm;
    ObjectsParamsControl: IAlgoObjectsParamsControl;
    ParamsControl: IAlgoObjectParamsControl;
    ParamControl: IAlgoObjectParamControl;
    i, j, c1, c2: Integer;
Begin
    MB := MetabaseClass.Active;
    // Get calculation algorithm
    MObj := MB.ItemById("ALGORITHM");
    Algo := CalcObjectFactory.CreateCalcObject(MObj, True);
    CalcAlgo := Algo As ICalcAlgorithm;
    // Description of parametric repository object added in calculation algorithm
    ObjectsParamsControl := CalcAlgo.ObjectParamsControl;
    c1 := ObjectsParamsControl.Count;
    For i := 0 To c1 - 1 Do
        ParamsControl := ObjectsParamsControl.Item(i);
        Debug.WriteLine("Object parameter control: " + ParamsControl.ObjectDesc.Name);
        Debug.Indent;
        c2 := ParamsControl.Count;
        For j := 0 To c2 - 1 Do
            ParamControl := ParamsControl.Item(j);
            Debug.WriteLine("Object parameter: " + ParamControl.ObjectParam.Name +
                " <-> Algorithm parameter: " + ParamControl.AlgParam.Name);
        End For;
        Debug.Unindent;
    End For;
End Sub UserProc;

After executing the example, the development environment console displays information about repository object parameter control settings contained in the calculation algorithm.

See also:

IAlgoObjectsParamsControl