- Use conditions
- Type of search
- Browsing table
- Various
TableSeek (Function) In french: TableCherche
// Finds the "Shirt" element in the "COL_Product" column // Generic search performed from row 5 let ResSearch = TableSeek(COL_Product, "Shirt", searchStartsWith, 5)
// Used to list all occurrences of a sought value. Result1 is int Result1 = TableSeek(COL_ColumnName, "SoughtValue", searchExactMatch) WHILE Result1 <> -1 Trace(Result1) Result1 = TableSeek(COL_ColumnName, "SoughtValue", ... searchExactMatch, Result1 + 1) END
Syntax
Seeking an element in a column Hide the details
<Result> = TableSeek(<Column name> , <Sought element> [, <Type of search> [, <Source row>]])
<Result>: Integer - Subscript of element found,
- -1 if no element corresponds to the search.
If the search is performed: - in a memory Table control, the element found is not selected. To select the element found, use TableSelectPlus.
- in a browsing Table control, the element found is not selected, the rows found in the Table control scroll until the sought element is reached.
<Column name>: Character string (with or without quotes) Name of 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 browsing Table or TreeView Table control, the search column must be linked to a key item. No search can be performed on a column that is not linked to an item. <Sought element>: Type of sought element Element that must be found in the specified column. If the type of the sought element is:- "Date" or "Time": the search is performed on the returned value.
- "Currency + Euro": the search is performed on the stored currency.
<Type of search>: Optional Integer constant Type of search to perform:
<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 for a browsing Table control. Remarks Type of search - Exact-match search: The elements whose value is strictly equal to <Sought element> are returned by TableSeek. For example:
// Return all customers whose name is "Smith" from "COL_NameColumn" TableSeek(COL_NameColumn, "Smith")
- Generic search: The elements starting with <Sought element> are returned by TableSeek.
For example:
// Return all customers whose name starts with "SMI" TableSeek(COL_NameColumn, "SMI", searchStartsWith)
Various - In a memory Table control, the search performed by TableSeek is not case sensitive (uppercase/lowercase characters).
- In a browsing Table control, the search performed by TableSeek takes into account the search characteristics defined in the analysis for the item linked to the search column (case sensitivity, etc.).
This page is also available for…
|
|
|
| |
| | n_EXISTE is int=TableSeek(COL_Nome,SAI_nome,True) IF n_EXISTE=-1 THEN Info("nao existe") ELSE Info("existe") END //em Frances n_EXISTE_frances est entier=TableCherche(COL_Nome,SAI_nome,Vrai) SI n_EXISTE_frances=-1 ALORS Info("nao existe") SINON Info("existe") FIN //Blog com video e exemplo http://windevdesenvolvimento.blogspot.com.br/2016/02/curso-windev-tabela-008-tableseek.html |
|
|
|
| |
| |
| |
|
| Exemplo TableSeek - Ler uma Coluna Tabela |
|
| FOR ALL ROW OF TABLE_local // aqui estou varrendo toda tabela Info(TABLE_local.COL_nome_arquivo) // estou mostrando uma coluna n_existe is int=TableSeek(TABLE_remoto.COL_nome_arquivo,TABLE_local.COL_nome_arquivo,True) // estou lendo uma coluna tabela IF n_existe<>-1 THEN // verificando se existe na tabela Info("Existe na Tabela") ELSE Info("nao existe") END END |
|
|
|
| |
| |
| |
| |
| |
| |
| | |
|