ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Looper functions
  • Use conditions
  • Multi-selection Looper
  • Handling errors
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
<Looper>.MoveLine (Function)
In french: <Zone répétée>.DéplaceLigne
Moves a row or swaps two rows in a Looper control.
Example
// Echange la répétition en cours et la répétition 5
ZR_ZoneRépétée1.DéplaceLigne(rowSelected, 5, amSwap)
// Déplace la répétition en cours à la répétition 3
ZR_ZoneRépétée1.DéplaceLigne(rowSelected, 3, amMove)
// Echange la ligne en cours avec la ligne suivante
ZR_ZoneRépétée1.DéplaceLigne(rowSelected, amNext, amSwap)
Syntax

Moving to a specific position Hide the details

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

Moving relatively to the current position Hide the details

<Result> = <Looper control>.MoveLine(<Index of row to move> , <Relative move> [, <Operation to perform>])
<Result>: Integer
New index of the row that was moved.
<Looper control>: Control name
Name of the Looper control to be used.
<Index of row to move>: Integer
Position of the row to move. This position must be included between 1 and the number of rows found in the control (returned by <Looper>.Count or Count for example).
To move the row that is currently selected, use the rowSelected constant.
<Relative move>: Integer constant
Used to move or a swap to a position relative to the index of the row to move.
amFirstMoves the row to first position.
amLastMoves the row to the last position.
amNextMoves the row one position to the bottom.
amNextPageMoves the row one page to the bottom (a page corresponds to the number of rows that can be simultaneously displayed in the Looper control).
amPreviousMoves the row one position upwards.
amPreviousPageMoves the row one page to the top (a page corresponds to the number of rows that can be simultaneously displayed in the Looper control).

If this parameter is invalid (amPrevious used on the first row of the Looper control for example), the row is moved "to the nearest" position.
<Operation to perform>: Optional Integer constant (or combination of constants)
Change of row position:
amDisplayDestinationThe modified row is displayed. If necessary, an automatic scroll of rows is performed to display the modified row. The selected row (selection bar) does not change.
This constant can be combined with the amMove and amSwap constants.
amMove
(default value)
The row is moved to the index of the destination row.
amSwapThe source row and the destination row are swapped.
Remarks

Use conditions

<Looper>.MoveLine can be used on:
  • a Looper control with in-memory data source,
  • a Looper control populated programmatically.
WEBDEV - Browser code This function is not available for Linear Looper controls. This function is available for Looper controls in browser mode only.
WEBDEV - Server codePHP This function is available for Looper controls in AJAX mode, Looper controls in classic mode and Linear Looper controls.
WINDEVReports and QueriesAndroidJavaUser code (UMC)

Multi-selection Looper

If <Looper>.MoveLine is used on a multi-selection Looper control:
  • when moving repeats/rows (constant tdDéplace): all selected repeats/rows will be moved.
  • when exchanging rows/repeats (constant tdEchange): only the first selected row/repeat will be exchanged.
  • the rowSelected constant cannot be used. Otherwise, a fatal error occurs and no row will be moved.

Handling errors

Caution: <Looper>.MoveLine does not return an error code.. To determine if this function has generated an error, use ErrorInfo with the errMessage constant.
Component: wd300obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/26/2024

Send a report | Local help