Use conditions Type of search Data-bound Table control file Miscellaneous
TableSearch (Function)
In french: TableCherche
Warning
From version
27 ,
TableSeek is kept for backward compatibility. This function has been replaced with
TableSearch .
Performs a search in:
a Table control, a TreeView Table control, a table displayed in a Combo Box control. Two search modes are available:
Search for an element in a column. Search for an element in the stored value of control.
let ResCherche = TableSearch ( COL_Produit , "Chemise" , searchStartsWith , 5 )
Résultat1 is int
Résultat1 = TableSearch ( COL_NomColonne , "ValeurRecherchée" , searchExactMatch )
WHILE Résultat1 < > - 1
Trace ( Résultat1 )
Résultat1 = TableSearch ( COL_NomColonne , "ValeurRecherchée" , ...
searchExactMatch , Résultat1 + 1 )
END
Syntax
Searching for an element in a column Hide the details
<Result> = TableSearch(<Column name> , <Search element> [, <Type of search> [, <Source row>]])
<Result>: Integer
Index of the element found, -1 if no element corresponds to the search. If the search is performed:
in a Table control populated programmatically, the element found is not selected. To select the element found, use TableSelectPlus . in a Table control based on a data file, the element found is not selected, the rows in the Table control scroll until the search element is reached. <Column name>: Character string
Name of the column where the search is performed. If this parameter corresponds to an empty string (""), the column to which the current process belongs will be used.In a Table or TreeView Table control based on a data file , the search column must be bound to a key item. No search can be performed in a column that is not bound to an item.
<Search element>: Type of search element
Element to be found in the specified column. If the type of the search element is:"Date" or "Time": the search is performed on the returned value. "Monetary + Euro": the search is performed on the memorized currency. <Type of search>: Optional Integer constant
Type of search to perform: searchContains Generic search of type "Contains" The elements whose value contains <Search element> are returned.
searchDefault Default search . for this function, the default search is an exact-match search (whose type is "Equals to"). The elements whose value is strictly equal to <Search element> are returned.
Warning: In a table populated programmatically, spaces at the beginning of the text are ignored.
searchExactMatch (or True for compatibility) (Default value)Exact-match search ("Equals to")The elements whose value is strictly equal to <Search element> are returned.
Warning: In a table populated programmatically, spaces at the beginning of the text are ignored.
searchStartsWith (or False for compatibility)Generic search whose type is "Starts with" The elements whose value starts with <Search element> are returned.
Warning: In a table populated programmatically, spaces at the beginning of the text are ignored.
<Source row>: Optional integer
Number of the source row for the search. If this parameter is not specified, the search is performed in the entire column. This parameter is used to find all the occurrences of a string in a column. This parameter is ignored in Table controls based on a data file. Remarks
Use conditions
Syntax 1 : The search for an element in a column is available for:
Table or TreeView Table controls based on a data file. Table or TreeView Table controls populated programmatically. tables displayed in a Combo Box control, Table controls in "Browser" mode, single-selection or multi-selection controls. Reminder Multi-selection is not available for "Server" Table controls. For a Table or TreeView Table control based on a data file:
the iteration mode must be automatic. the column must be bound to a key item. Type of search
Exact Match : Only elements with a value strictly equal to <Searched Element> are returned by the function TableSearch . For example:
TableSearch ( COL_ColonneNom , "Dupond" )
Warning: In a table populated programmatically, spaces at the beginning of the text are ignored. Generic Search : Items starting with <Searched Element> are returned by the function TableSearch . For example:
TableSearch ( COL_ColonneNom , "DUP" , searchStartsWith )
Miscellaneous
In a table populated programmatically the search performed with the TableSearch : is not case sensitive. ignores leading spaces. In a Table control based on a data file , the search performed by TableSearch takes into account the search characteristics defined in the analysis for the item bound to the search column (case sensitivity, etc.).Business / UI classification: UI Code
This page is also available for…