ICalcAlgorithm.Included

Syntax

Included(CalcObject: ICalcObject): Boolean;

Parameters

CalcObject. Calculation algorithm object.

Description

The Included property determines including or excluding of object from calculation algorithm.

Comments

Available values:

Example

Executing the example requires that the repository contains a calculation algorithm with the ALGORITHM identifier. The calculation algorithm should contains at least two objects.

Add links to the Algo and Metabase system assemblies. Add links to the assemblies required for working with calculation algorithms.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObjectDescriptor;
    Algo: ICalcObject;
    List: ICalcObjectsList;
    CalcAlgo: ICalcAlgorithm;
    Block: ICalcObject;
Begin
    MB := MetabaseClass.Active;
    // Get calculation algorithm
    MObj := MB.ItemById("ALGORITHM");
    Algo := CalcObjectFactory.CreateCalcObject(MObj, True);
    CalcAlgo := Algo As ICalcAlgorithm;
    // Get list of calculation algorithm objects
    List := CalcAlgo.Items;
    // Exclude the first object from calculation
    Block := List.Item(0As ICalcObject;
    CalcAlgo.Included(Block) := False;
    // Check if there are changes in calculation algorithm
    If CalcAlgo.IsDirty Then
        // Display name of excluded object in the console
        Debug.WriteLine("«" + Block.Name + "»" + " is excluded from calculation");
        // Save changes in calculation algorithm
        CalcAlgo.SaveObject;
    End If;
End Sub UserProc;

After executing the example the first object of calculation algorithm is excluded from calculation. The console displays name of the excluded object, for example:

«Function block» is excluded from calculation

See also:

ICalcAlgorithm