PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Operating mode on a Combo Box control
  • Multiselection 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 Android applications.
New in version 15
Android This function is now available for Android applications.
Android This function is now available for Android applications.
Versions 16 and later
WINDEVLinux This function is now available for WINDEV applications in Linux.
New in version 16
WINDEVLinux This function is now available for WINDEV applications in Linux.
WINDEVLinux This function is now available for WINDEV applications in Linux.
Example
// Swap the current row and row 5
ListMoveRow(LIST_List1, rowSelected , 5, amSwap)
// Move the current row to row 3
ListMoveRow(LIST_List1, rowSelected , 3, amMove)
// Swap the current row with the next row
ListMoveLine (LIST_List1, rowSelected, amNext, amSwap)
Syntax

Moving 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 ..Count 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 ..Count 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 and destination rows are swapped.

Moving relatively 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 ..Count 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 upwards
amFirstMoves the row to first position.
amNextMoves the row one position downwards.

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 and destination rows are swapped.
Remarks

Operating mode on a Combo Box control

When ListMoveRow 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.

Multiselection List Box control

If ListMoveRow is used on a multiselection List Box control:
  • when moving rows (amMove constant): all 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: ListMoveRow returns no error code. To find out whether an error was generated by this function, use ErrorInfo associated with the errMessage constant.
Component : wd240obj.dll
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