PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Operating mode on a combo box
  • Multi-selection List Box control
  • Managing errors
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Moves a row or swaps two rows in a List Box or Combo Box control.
Notes:
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 16 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
New in version 16
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Example
// Swaps the current row and row 5
ListMoveLine(LIST_List1, rowSelected , 5, amSwap)
// Moves the current row to row 3
ListMoveLine(LIST_List1, rowSelected , 3, amMove)
// Swaps the current row with the next row
ListMoveLine (LIST_List1, rowSelected, amNext, amSwap)
Syntax

Move to a specific position Hide the details

<Result> = ListMoveLine(<List Box Control> , <Subscript of Row to Move> , <Subscript of Destination Row> [, <Operation to Perform>])
<Result>: Integer
New subscript of row that was moved.
<List Box Control>: Control name
Name of List Box or Combo Box control to use. If this parameter corresponds to an empty string (""), the control to which the current process belongs will be used.
<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 List Box or Combo Box control (returned by ListCount or ..Occurrence for example).
To move the row that is currently selected, use the rowSelected constant.
<Subscript of Destination Row>: Integer
New row position. This position must be included between 1 and the number of rows found in the List Box or Combo Box control (returned by ListCount or ..Occurrence for example). 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 list box. An automatic scroll of the rows is performed if necessary to display the modified row. The selected row (selection bar) is not modified.
This constant can be combined with the amMove and amSwap constants.
WEBDEV - Server codePHP This constant is not available.
amMove
(default value)
The row is moved toward the subscript of destination row.
amSwapThe source row and the destination row are swapped.

Move relative to the current position Hide the details

<Result> = ListMoveLine(<List Box control> , <Subscript of Row to Move> , <Relative Move> [, <Operation to Perform>])
<Result>: Integer
  • New subscript of row that was moved,
  • 0 if an error occurred.
<List Box control>: Control name
Name of List Box control to use. If this parameter corresponds to an empty string (""), the control to which the current process belongs will be used.
<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 List Box control (returned by ListCount or ..Occurrence for example).
To handle the row that is currently selected, use the rowSelected constant.
<Relative Move>: Integer constant
Used to perform a move or a swap on a position relative to the subscript of row to move.
amLastMoves the row to last position.
amPreviousPageMoves the row one page to the top (a page corresponds to the number of rows that can be simultaneously displayed in the List Box control).
WEBDEV - Server codePHP This constant is not available.
amNextPageMoves the row one page to the bottom (a page corresponds to the number of rows that can be simultaneously displayed in the List Box control).
WEBDEV - Server codePHP This constant is not available.
amPreviousMoves the row one position to the top.
amFirstMoves the row to first position.
amNextMoves the row one position to the bottom.

If this parameter is invalid (amPrevious used on the first row of List Box control for example), the row is moved "to the nearest" position.
<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 List Box control. An automatic scroll of the rows is performed if necessary to display the modified row. The selected row (selection bar) is not modified.
This constant can be combined with the amMove and amSwap constants.
WEBDEV - Server codePHP This constant is not available.
amMove
(default value)
The row is moved toward the subscript of destination row.
amSwapThe source row and the destination row are swapped.
Remarks

Operating mode on a combo box

When ListMoveLine is used on a Combo Box control, the selected element remains the same. The subscript of selected element in the list (which means the value returned by the Combo Box control) is modified.

Multi-selection List Box control

If ListMoveLine is used on a multi-selection List Box control:
  • when moving a row (amMove constant): all the selected rows 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.

Managing errors

Caution: ListMoveLine returns no error code. To find out whether an error was generated by this function, use ErrorInfo associated with the errMessage constant.
Components
WINDEVReports and Queries wd230obj.dll
WEBDEV - Server code wd230page.dll
Windows Mobile wp230obj.dll
Java wd230java.jar
Linux wd230obj.so
Android wd230android.jar
Minimum required version
  • Version 14
This page is also available for…
Comments
Exemplo ListMoveLine
gn_indice++
IF gn_indice>6 THEN
gn_indice=1
END

ListMoveLine(LIST_List1,rowSelected,gn_indice,amSwap)

--
gn_indice--
IF gn_indice=0 THEN
gn_indice=6
END

ListMoveLine(LIST_List1,rowSelected,gn_indice,amSwap)

//Blog com Video e Exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/11/aula-961-curso-windev-listbox-005.html
https://www.youtube.com/watch?v=nyRX7nrKzts
De matos
Dec. 04 2016
Exemplo ListBox Mover Linha

//Codigo Inicializacao janela
// Elimina dados do Listbox
ListDeleteAll(LISTE_programa)
// Ler a tabela de clientes e preenche ListBox
FOR EACH cliente
ListAdd(LISTE_programa,cliente.nome)
END

//Sélection Combo
SWITCH COMBO_selecione
CASE 1
CASE 2
ListMoveLine(LISTE_programa,rowSelected,amNext)
CASE 3
ListMoveLine(LISTE_programa,rowSelected,amPrevious)
CASE 4
ListMoveLine(LISTE_programa,rowSelected,amFirst)
CASE 5
ListMoveLine(LISTE_programa,rowSelected,amLast)
OTHER CASE
END

//Blog com Video e exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/04/curso-windev-listbox-004-listmoveline.html
De matos AMARILDO
Apr. 18 2016