moveRow

moveRow(src: Integer;
        dst: Integer);

The moveRow method of the Table class can be used to move a row of the current sheet of a table. The current row is adjusted if that row is affected. The src parameter specifies the source row (that is, the row to be moved) and the dst parameter specifies the destination of the moved row. The code fragment in the following example of the moveRow method moves row 4 to row 2. Row 2 becomes row 3, and row 3 becomes row 4.

table1.moveRow(4, 2);

The code fragment in the following example of the moveRow method moves row 2 to row 4. Row 3 becomes row 2, and row 4 becomes row 3.

table1.moveRow(2, 4);

The method in the following example shows the use of the moveRow method.

buttonFind_click(btn: Button input) updating;
vars
    row : Integer;
begin
    table1.clearAllSelected;
    if textBoxFind.text <> null then
        table1.column  := comboBoxColumns.listIndex;
        foreach row in 1 to table1.rows do
            table1.row := row;
            if table1.text = textBoxFind.text then
                table1.moveRow (row, 2);
                table1.selected := true;
                return;
            endif;
        endforeach;
        app.msgBox("No match found", " ", MsgBox_OK_Only);
        return;
    else
        app.msgBox("You must enter something to search for", "No search
                   name entered", MsgBox_OK_Only);
        return;
    endif;
end;