ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / List Box functions
  • Equivalence
  • Value of the selected element
  • Miscellaneous
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Returns the index of the selected element in a List Box, ListView or Combo Box control.
Reminder The selected item corresponds to the current item on which the selection banner is displayed.
Note: The ListSelect function can be used on both:
  • List Box controls based on a data file or populated programmatically,
  • single-selection or multi-selection List Box controls.
PHP In this version, ListSelect cannot be used on multi-selection List Box controls.
// Indice de l'élément sélectionné dans le champ "LISTE_ListeClient"
ResIndiceElément = ListSelect(LISTE_ListeClient)
// Lignes sélectionnées dans un champ Liste multisélection
i is int = 1
IndiceLigneSelectionnee is int
IndiceLigneSelectionnee = ListSelect(LISTE_Liste1, 1)
WHILE IndiceLigneSelectionnee <> -1
	Trace("La ligne n°" + IndiceLigneSelectionnee + " est sélectionnée")
	i++
	IndiceLigneSelectionnee = ListSelect(LISTE_Liste1, i)
END

// Équivalent à :
// POUR TOUTE LIGNE SELECTIONNEE DE LISTE_Liste1
//	 Trace("La ligne n°" + LISTE_Liste1 + " est sélectionnée")
// FIN
Syntax
<Result> = ListSelect(<List Box control> [, <Rank>])
<Result>: Integer
  • Index of the selected element in the specified List Box (or Combo Box) control,
  • -1 if no element is selected.
For a multi-selection List Box control, the rank of the selected element must be specified <Rank>).
<List Box control>: Control name
Name of List Box (or Combo Box) control to use. If this parameter corresponds to an empty string (""), the index of the element selected in the List Box control (or Combo Box) to which the current event belongs is returned.
WEBDEV - Browser code The name of the List Box (or Combo Box) control to use must be specified.
<Rank>: Optional integer
Rank of selection for a multi-selection List Box control. If this parameter is not specified, the index of the first selected element is returned.
For example: To retrieve the first item selected, the rank will be 1, to retrieve the second item selected, the rank will be 2, etc.
Remarks

Equivalence

The following syntaxes are equivalent:
Index is int
Index = <List Box control>
and
Index = ListSelect(<List Box control>)

Value of the selected element

To retrieve the value of the selected element, the syntax is:
Index is int
Index = ListSelect(<List Box control>)
<Element value> = <List Box control>[Index]
and
<Element value> = <List Box control>[<List Box control>]

Miscellaneous

  • To get the index of the element selected in a Table control, use TableSelect.
  • ListSelect can be used on a "Combo Box" table column.
Component: wd300obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
//Capturar valores de uma List com Mutiplas Seleções
//Capturar valores de uma List com Mutiplas Seleções
Total is int = ListSelectCount(List_Clientes)
x is int
Loop(total)
x++
trace(List_Clientes[ListSelect(List_Clientes, x)])
trace(List_Clientes[ListSelect(List_Clientes, x)]..Storevalue)
trace(List_Clientes[ListSelect(List_Clientes, x)]..value)
end
BOLLER
20 May 2019

Last update: 03/28/2025

Send a report | Local help