ITabCellIterator.Next

Syntax

Next: Boolean;

Description

The Next method moves the next element of iterator.

Comments

First call of the method performs the transfer to the first element of iterator.

Example

Executing the example requires to create a form and locate the following components on it:

Enable the link to the Tab system assembly.

Add the Button1 and Button2 clicks event handler:

Class ITERATORForm: Form
    TabSheetBox1: TabSheetBox;
    UiTabSheet1: UiTabSheet;
    Button1: Button;
    Button2: Button;
    iter : ITabCellIterator;
    tab : ITabSheet;
    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Begin
        tab:= UiTabSheet1.TabSheet;
        //create iterator for the selected cells range:
        iter := tab.View.Selection.Range.CreateIterator;
        //determine the order by columns
        iter.Order := TabCellIteratorOrder.Columns;
    End Sub Button1OnClick;
    Sub Button2OnClick(Sender: Object; Args: IMouseEventArgs);
    Begin
       //in the table select the cells to which the iterator moves

        If iter.Next Then
            tab.View.Selection.Range := tab.Cell(iter.CurrentRow,iter.CurrentColumn);
        End If;
    End Sub Button2OnClick;
End Class ITERATORForm;

The form is created after example execution. Enter the values to some cells and select the range which includes this cells:

On clicking the Button1 button (the Create Iterator button in given example), the iterator is created for the selected table range and the By Columns move order to the cells in the table is specified.

Click the Button2 button (the Next button in the given example). The first cell containing the value (the cell A1 in the given example) is selected. The further clicking on the Button2 button selects the cells by which the iterator moves. The move order is set By Columns and the cells are selected in the following order: A1-B2-B3-C0-D2. At the move order selection By Rows the cells are selected in the following order: C0-A1-B2-D2-B3.

See also:

ITabCellIterator