PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Equivalence
  • Value of selected element
  • Miscellaneous
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
Returns the subscript of the selected element in a List Box (or ListView) control or in a Combo Box control.
Reminder: The selected element corresponds to the current element onto which the selection bar is displayed.
Note: ListSelect can be used on:
  • the browsing or memory List Box controls,
  • single-selection or multiselection Looper controls.
PHP In this version, ListSelect cannot be used on multiselection List Box controls.
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.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 18 and later
Android This function is now available for Android applications.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android This function is now available for Android applications.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android This function is now available for Android applications.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
// Subscript of selected element in "LIST_CustomerList"
ResElementSubscript = ListSelect(LIST_CustomerList)
// Rows selected in a multiselection List Box control
i is int = 1
SelectedRowSubscript is int
SelectedRowSubscript = ListSelect(LIST_List1, 1)
WHILE SelectedRowSubscript <> -1
Trace("Row #" + SelectedRowSubscript + " is selected")
i++
SelectedRowSubscript = ListSelect(LIST_List1, i)
END

// Equivalent to:
// FOR EACH SELECTED ROW OF LIST_List1
// Trace("Row #" + LIST_List1 + " is selected")
// END
Syntax
<Result> = ListSelect(<List Box control> [, <Rank>])
<Result>: Integer
  • Subscript of the element selected in the specified List Box (or Combo Box) control,
  • -1 if no element is selected.
For a multiselection 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 subscript 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 multiselection List Box control. If this parameter is not specified, the subscript of first selected element is returned.
For example: To retrieve the first selected element, the rank will be 1, to retrieve the second selected element, the rank will be 2, etc.
Remarks

Equivalence

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

Value of selected element

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

Miscellaneous

  • To find out the subscript of selected element in a Table control, use TableSelect.
  • ListSelect can be used on a "Combo Box" table column.
Component : wd240obj.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