ILanerCellAttributes.MoveTo

Fore Syntax

MoveTo(FromIndex: Integer; ToIndex: Integer);

Fore.NET Syntax

MoveTo(FromIndex: integer; ToIndex: integer);

Parameters

FromIndex. Index of attribute start position.

ToIndex. Index of the position, into which the attribute should be shifted.

Description

The MoveTo method moves the specified attribute to the required position.

Comments

Indexation of attributes in the collection starts with zero. To get the number of collection attributes, use the ILanerCellAttributes.Count property.

Fore Example

Executing the example requires the repository contains a workbook with the WORKBOOK_CMT identifier that contains several series. It is also required to set several attributes used to form comments for series observations.

Add links to the Express, Laner and Metabase system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    WbkObj: IMetabaseObject;
    EaxAn: IEaxAnalyzer;
    Laner: ILaner;
    CommentAttr: ILanerCellAttributes;
Begin
    // Get workbook
    mb := MetabaseClass.Active;
    WbkObj := mb.ItemById("WORKBOOK_CMT").Edit;
    EaxAn := WbkObj As IEaxAnalyzer;
    Laner := EaxAn.Laner;
    // Get collection of comment attributes
    CommentAttr := Laner.CommentAttributes;
    // If there are more than two attributes in the collection, swap them
    If CommentAttr.Count >= 2 Then
        CommentAttr.Move(01);
    End If;
    // Save changes
    WbkObj.Save;
End Sub UserProc;

After executing the example the first and the second attribute are swapped in the collection.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Laner;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    WbkObj: IMetabaseObject;
    EaxAn: IEaxAnalyzer;
    Laner: ILaner;
    CommentAttr: ILanerCellAttributes;
Begin
    // Get workbook
    mb := Params.Metabase;
    WbkObj := mb.ItemById["WORKBOOK_CMT"].Edit();
    EaxAn := WbkObj As IEaxAnalyzer;
    Laner := EaxAn.Laner;
    // Get collection of comment attributes
    CommentAttr := Laner.CommentAttributes;
    // If there are more than two attributes in the collection, swap them
    If CommentAttr.Count >= 2 Then
        CommentAttr.Move(01);
    End If;
    // Save changes
    WbkObj.Save();
End Sub;

See also:

ILanerCellAttributes