ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / List Box functions
  • Equivalence
  • 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 element selected corresponds to the current element on which selection bar is displayed.
Note: The <List Box>.Select 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, <List Box>.Select cannot be used on multi-selection List Box controls.
Example
// Indice de l'élément sélectionné dans le champ "LISTE_ListeClient"
ResIndiceElément = LISTE_ListeClient.Select()
// Lignes sélectionnées dans un champ Liste multisélection
i is int = 1
IndiceLigneSelectionnee is int
IndiceLigneSelectionnee = LISTE_Liste1.Select(1)
WHILE IndiceLigneSelectionnee <> -1
	Trace("La ligne n°" + IndiceLigneSelectionnee + " est sélectionnée")
	i++
	IndiceLigneSelectionnee = LISTE_Liste1.Select(i)
END

// Équivalent à:
// POUR TOUTE LIGNE SELECTIONNEE DE LISTE_Liste1
//	 Trace("La ligne n°" + LISTE_Liste1 + " est sélectionnée")
// FIN
Syntax
<Result> = <List Box control>.Select([<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.
<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:
Indice est un entier
Indice = <Champ Liste>
and
Indice = <Champ Liste>.Select()

Miscellaneous

  • To get the index of the element selected in a Table control, use <Table>.Select.
  • <List Box>.Select can be used on a "Combo Box" table column.
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