|
|
|
|
|
- Type of search
- parameter
- Uppercase/Lowercase characters
- Seeking and selecting an element in a List Box or Combo Box control
- Seeking an element in a List Box or Combo Box control based on a data file: search on the stored value or on the displayed value
- Search and selection in a List Box control
- Miscellaneous
<List Box>.Seek (Function) In french: <Liste>.Cherche Seeks an element in a List Box control (standard list box or listview) or in a Combo Box control (including the values described by gStoredValue). Remark: <List Box>.Seek can be used on: - List Box controls based on a data file or populated programmatically,
- single-selection or multi-selection List Box controls.
// Find the element "Moore" in the List Box control "LIST_CustomerList" ResSeek = LIST_CustomerList.Seek("Moore")
Syntax
<Result> = <List Box control>.Seek(<Search element> [, <Type of search> [, <Start of search>]])
<Result>: Integer - Index of the element found.
- -1 if no element corresponds to the search.
The element found is not selected. To select the element found, use <List Box>.SelectPlus.
<List Box control>: Control name Name of List Box (or Combo Box) control to use. <Search element>: Character string 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.
<Start of search>: Optional integer Index 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 controls handled programmatically.
Remarks Type of search - Exact-match search:
The elements whose value is strictly equal to <Search element> are returned by <List Box>.Seek. For example:
// Return all the customers named "Doe" found in "LIST_Name" LIST_Name.Seek("Doe")
- Generic search:
The elements starting with <Search element> are returned by <List Box>.Seek. For example:
// Return all customers whose name starts with "SMI" LIST_Name.Seek("SMI", False)
<Start of search> parameter The <Start 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:
Index is int Cnt is int = 0 // Position on the first corresponding element Subscript = LIST_CustomerList.Seek("SMI", False) WHILE Index <> -1 Cnt++ // Find the next name starting with "SMI" Subscript = LIST_CustomerList.Seek("SMI", False, Subscript + 1) END
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|