PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Type of Search
  • "Beginning of Search" parameter
  • Uppercase/Lowercase characters
  • Seeking and selecting an element found in a List Box or Combo Box control
  • Search in a browsing List Box or Combo Box control: search on the stored value or on the displayed value
  • Search and selection in a List Box control
  • 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
Seeks an element in a List Box control (standard list box or listview) or in a Combo Box control (including the values described by gLink).
WEBDEV - Browser code In this version, the values described by gLink cannot be sought.
Note: ListSeek can be used on:
  • the browsing or memory List Box controls,
  • the single-selection or multi-selection List Box controls.
PHP Reminder: The browing List Box controls are not available in this version.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
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
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
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.
Example
// Find the customer named "Moore" in "LIST_CustomerList"
ResSeek = ListSeek(LIST_CustomerList, "Moore")
WINDEVWEBDEV - Server codeWEBDEV - Browser codeReports and QueriesAndroidWindows MobileUniversal Windows 10 AppJavaAjaxUser code (UMC)
// Find the customer named "Moore" in the browsing list "LIST_CustomerList"
// Exact-match search from element 5
ResFind = ListSeek(LIST_CustomerList, "Moore", True, 5)
Syntax
<Result> = ListSeek(<List Box Control> , <Sought Element> [, <Type of Search> [, <Start of Search>]])
<Result>: Integer
  • Subscript of element found.
  • -1 if no element corresponds to the search.
The element found is not selected. To select the element found, use ListSelectPlus.
WINDEV In a browsing List Box control, the element found is displayed if it is not visible.
<List Box Control>: Control name
Name of List Box (or Combo Box) control to use.
If this parameter corresponds to an empty string (""), the element is sought in the control to which the current process belongs.
WEBDEV - Browser code The name of List Box or Combo Box control to use must necessarily be specified.
<Sought Element>: Character string (with quotes)
Element to find in the specified List Box (or Combo Box) control.
<Type of Search>: Optional boolean
  • True (default value) for an exact-match search,
  • False for a generic search.
PHP This parameter is not available. An exact-match search is performed by default.
<Start of Search>: Optional integer
Subscript from which the search will start in the List Box or Combo Box control.
If this parameter is not specified, the search is performed in the entire control. This parameter is ignored for the memory list boxes.
PHP This parameter is not available. The search is performed in the entire control by default.
Remarks

Type of Search

  • Exact-match search:
    The elements whose value is strictly equal to <Sought Element> are returned by ListSeek. For example:
    // Return all the customers named "Doe" found in "LIST_Name"
    ListSeek(LIST_Name, "Doe")
  • Generic search:
    The elements starting with <Sought Element> are returned by ListSeek. For example:
    // Return all the customers whose name starts with "SMI"
    ListSeek(LIST_Name, "SMI", False)

"Beginning of Search" parameter

The <Beginning of Search> parameter is used to find all the occurrences of a string in a List Box or Combo Box control.
For example, to count the number of names starting with "SMI" in the "LIST_CustomerList" control:
Subscript is int
Cnt is int = 0
// Position on the first corresponding element
Subscript = ListSeek(LIST_CustomerList, "SMI", False)
WHILE Subscript <> -1
Cnt++
// Find the next name starting with "SMI"
Subscript = ListSeek(LIST_CustomerList, "SMI", False, Subscript + 1)
END
WINDEVWEBDEV - Server codeReports and QueriesAndroidiPhone/iPadWindows MobileUniversal Windows 10 AppJavaPHPAjaxUser code (UMC)

Uppercase/Lowercase characters

  • If the control is a memory List Box control, the search ignores the uppercase and lowercase characters.
  • If the control is a browsing List Box control, the search performed on the "Key" items takes into account the "Search options" defined in the data model editor ("General" tab of item description).
PHP The search is case sensitive.
PHP The browsing list boxes are not available.
WINDEVWEBDEV - Server codeReports and QueriesAndroidiPhone/iPadWindows MobileUniversal Windows 10 AppAjaxUser code (UMC)

Seeking and selecting an element found in a List Box or Combo Box control

To seek and/or select an element found in a browsing List Box or Combo Box control, you also have the ability to use the following syntax:
LIST_OrderList..StoredItem = "CustomerID"
// Find and select the element whose CustomerID is "135"
LIST_OrderList = 135
// If the element sought is not found, LIST_OrderList will be set to -1
AndroidJava The sought element is selected.
WINDEVWEBDEV - Server codeReports and QueriesiPhone/iPadWindows MobileUniversal Windows 10 AppAjaxUser code (UMC)

Search in a browsing List Box or Combo Box control: search on the stored value or on the displayed value

Case 1: The List Box or Combo Box control is filled by a file ("Direct access" option):
The search is performed according to the value of gLinkActivate:
  • If gLinkActivate(Control, True) (by default): ListSeek performs the search on the "search item" declared in the "Content" tab of control description.
  • If gLinkActivate(Control, False): ListSeek performs the search on the "displayed item" declared in the "Content" tab of control description.
Case 2: The List Box or Combo Box control is filled by a file ("Loaded in memory" option):
ListSeek performs the search on the "displayed item" declared in the "Content" tab of control description.
WINDEVWEBDEV - Server codeReports and QueriesAndroidiPhone/iPadWindows MobileUniversal Windows 10 AppJavaAjaxUser code (UMC)

Search and selection in a List Box control

If the options used to fill the List Box control are defined in the description window of the control ("Content" tab), the following syntax can be used to seek and select an element in a List Box control:
ListName = SoughtElement
The options used to fill the list box are as follows:
  • Browsed file
  • Displayed item
  • Search item
WINDEVWEBDEV - Server codeWEBDEV - Browser codeReports and QueriesWindows MobileJavaAjaxUser code (UMC)

Various

  • To perform a search in a Table control or in a Combo Box control with table, use TableSeek.
  • ListSeek 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
ver se existe
Nessa dica de hoje,
vou mostrar como procurar,
para ver se existe ou nao no listbok
//====================
In this tip today,
I'll show you how to look,
To see if it exists or not in listbok
//====================
Dans cette astuce aujourd'hui,
Je vais montrer comment la recherche,
pour voir si le listbok ou non
//====================
s_Existe_ is string=ListSeek(LISTE_EstadosProgramacao,SAI_Uf)
IF s_Existe_ <> -1 THEN
// quer quizer que existe
Info("Existe"+LISTE_EstadosProgramacao)
ELSE
Info("Nao Existe Tabela")
END
//================
http://windevdesenvolvimento.blogspot.com.br/2017/03/aula-1082-windev-listbox-013-listbox.html

https://www.youtube.com/watch?v=5GkFp36Bbxw

De matos
Mar. 10 2017