ICalcAlgorithm.MoveObject

Syntax

MoveObject(Source: ICalcObject, Target: ICalcObject);

Parameters

Source. Calculation algorithm object to be moved.

Target. Calculation algorithm object, which place will be occupied by the specified object.

Description

The MoveObject method reorders calculation algorithm objects.

Example

Executing the example requires that the repository contains a calculation algorithm with the ALGORITHM identifier. The calculation algorithm should contains at least three 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;
    Source, Target: 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;
    // Move the first object to the place of the third one
    Source := List.Item(0As ICalcObject;
    Target := List.Item(2As ICalcObject;
    CalcAlgo.MoveObject(Block1, Block3);
    // Save changes in calculation algorithm
    CalcAlgo.SaveObject;
End Sub UserProc;

After executing the example the order of calculation object is changed in the calculation algorithm: the first object is moved to the place of the third one, the second object is moved to the place of the first one, and the third object is moved to the place of the second one.

See also:

ICalcAlgorithm