Home | Sign in | English EN
  • Use conditions
  • Multiselection Table control
  • Horizontal Table control
  • Managing errors
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
Moves a row or swaps two rows in a Table control. To move the columns in a Table control, use <Table>.MoveColumn.
// Swap the current row and row 5
TABLE_Table1.MoveLine(SelectedLine, 5, amSwap)
// Move the current row to row 3
TABLE_Table1.MoveLine(SelectedLine, 3, amMove)
// Swap the current row with the next row
TABLE_Table1.MoveLine(SelectedLine, 5, amNext, amSwap)

Moving to a specific position Hide the details

<Result> = <Table control>.MoveLine(<Subscript of row to move> , <Subscript of destination row> [, <Operation to perform>])
<Result>: Integer
New subscript of row that was moved.
<Table control>: Control name
Name of Table control to use.
<Subscript of row to move>: Integer
Position of row to move. This position must be included between 1 and the number of rows found in the Table control (returned by <Table>.Count or ..Count).
To move the row that is currently selected, use the rowSelected constant.
<Subscript of destination row>: Integer
New row position. This position must be between 1 and the number of rows of the Table control (returned by <Table>.Count or ..Count). A fatal error occurs if this parameter is not valid.
To handle the row that is currently selected, use the rowSelected constant.
<Operation to perform>: Optional Integer constant (or combination of constants)
Change of position that will be performed for the row:
amDisplayDestinationThe modified row is displayed in the Table control. An automatic scroll of the rows is performed if necessary to display the modified row in the Table control. The selected row (selection bar) is not modified.
This constant can be combined with the amMove and amSwap constants.
(default value)
The row is moved toward the subscript of destination row.
amSwapThe source row and the destination row are swapped.

Use conditions

The function <Table>.MoveLine can be used on:
  • a memory Table control.
  • a browsing Table control loaded in memory.
  • Reports and Queries a horizontal Table control.
This function cannot be used on the TreeView Table controls and on the browsing Table controls (direct access).
Remarks: Moving a row according to the type of control:

Multiselection Table control

If <Table>.MoveLine is used on a multiselection Table control:
  • when moving a row (amMove constant): only the first selected row will be moved.
  • when swapping rows (amSwap constant): only the first row will be swapped
  • the rowSelected constant cannot be used. Otherwise, a fatal error occurs and no row is moved.
Reports and Queries

Horizontal Table control

If <Table>.MoveLine is used on an horizontal Table control, the elements moved will be the columns.
To move the rows in an horizontal Table control, use <Table>.MoveColumn.

Managing errors

Caution: <Table>.MoveLine returns no error code. To find out whether this function has generated an error, use function ErrorInfo with constant errMessage.
Component : wd260obj.dll
Minimum version required
  • Version 23
This page is also available for…
Click [Add] to post a comment