PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Equivalence
  • Value of selected element
  • Various
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 element selected 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,
  • the single-selection or multi-selection List Box controls.
PHP In this version, ListSelect cannot be used on the multi-selection List Box controls.
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.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Android This function is now available for the 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 the Android applications.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android This function is now available for the 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 multi-selection List Box control
i is int = 1
SubscriptSelectedRow is int
SubscriptSelectedRow = ListSelect(LIST_List1, 1)
WHILE SubscriptSelectedRow <> -1
Trace("The row #" + SubscriptSelectedRow + " is selected")
i++
SubscriptSelectedRow = ListSelect(LIST_List1, i)
END

// Equivalent to:
// FOR EACH SELECTED ROW OF LIST_List1
// Trace("The row #" + LIST_List1 + " is selected")
// END
Syntax
<Result> = ListSelect(<List Box Control> [, <Rank>])
<Result>: Integer
  • Subscript of element selected in the specified list box (or combo box),
  • -1 if no element is selected.
For a multi-selection list box, 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 selected selected in the list box (or combo box) to which the current process belongs is returned.
WEBDEV - Browser code The name of list box (or combo box) to use must necessarily be specified.
<Rank>: Optional integer
Rank of selection for a multi-selection 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>]

Various

  • To find out the subscript of selected element in a Table control, use TableSelect.
  • ListSelect can be used on a "Combo box" table column.
Components
WINDEVReports and Queries wd230obj.dll
WEBDEV - Server code wd230page.dll
Windows Mobile wp230obj.dll
WEBDEV - Browser code WDJS.DLL
Java wd230java.jar
Linux wd230obj.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment