PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Use conditions
  • Type of Search
  • Browsing table
  • 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
Performs a search in:
  • a Table control,
  • a TreeView Table control,
  • WINDEVWindows Mobile a table displayed in a Combo Box control.
Two search modes are available:
  • Search for an element in a column.
  • Searching for an element in the stored value of control.
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 19 and later
WEBDEV - Browser code This function is now available in Browser code for the Browser Table controls.
New in version 19
WEBDEV - Browser code This function is now available in Browser code for the Browser Table controls.
WEBDEV - Browser code This function is now available in Browser code for the Browser Table controls.
Versions 20 and later
Android This function is now available for the Android applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 20
Android This function is now available for the Android applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Android This function is now available for the Android applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Example
// Finds the "Shirt" element in the "COL_Product" column
// Generic search performed from row 5
ResSearch = TableSeek(COL_Product, "Shirt", False, 5)
// Used to list all occurrences of a sought value.
Result1 is int
Result1 = TableSeek(COL_ColumnName, "SoughtValue", True)
WHILE Result1 <> -1
Trace(Result1)
Result1 = TableSeek(COL_ColumnName, "SoughtValue", ...
True, Result1 + 1)
END
// 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:
  • True (default value): Exact-match search ("Equals to"): The elements whose value is strictly equal to <Sought Element> are returned.
  • False: Generic search ("Starts with"): The elements whose value starts with <Sought Element> are returned.
Type of search to perform:
Versions 21 and later
searchStartsWith
New in version 21
searchStartsWith
searchStartsWith (or False for compatibility)
Generic search whose type is "Starts with"
The elements whose value starts with <Sought Element> are returned.
Versions 21 and later
searchContains
New in version 21
searchContains
searchContains
Generic search whose type is "Contains"
The elements whose value contains <Sought Element> are returned.
WEBDEV - Browser codePHP This constant is not available.
Versions 21 and later
searchDefault
New in version 21
searchDefault
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 <Sought Element> are returned.
WEBDEV - Browser codePHP This constant is not available.
Versions 21 and later
searchExactMatch
New in version 21
searchExactMatch
searchExactMatch (or True for compatibility)
(Default value)
Exact-match search ("Equals to")
The elements whose value is strictly equal to <Sought Element> are returned.
<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.
WINDEVWEBDEV - Server codeReports and QueriesWindows MobilePHPAjaxUser code (UMC)

Seeking an element in a Table control (stored value) Hide the details

<Result> = TableSeek(<Table Control> , <Sought Value>)
<Result>: Integer
  • Subscript of element found,
  • -1 if no element corresponds to the search.
<Table Control>: Control name
Name of control to use. This control can correspond to:
  • a Table control.
  • a TreeView Table control.
  • WINDEVWindows Mobile a Combo Box control with table.
The Table control must be linked to a data file or to a variable.
<Sought Value>: Type of sought element
Value of sought element. This value is sought in the stored value of control.
Remarks

Use conditions

Syntax 1: Seeking an element in a column is available for:
  • a Table or TreeView Table control,
  • a browsing or memory control,
  • WINDEVWindows Mobile a table displayed in a Combo Box control,
  • Versions 19 and later
    WEBDEV - Browser code a Browser Table control,
    New in version 19
    WEBDEV - Browser code a Browser Table control,
    WEBDEV - Browser code a Browser Table control,
  • a single-selection or multi-selection control.
    WEBDEV - Server codePHP Reminder: The multi-selection controls are available in Ajax only. WEBDEV - Server codePHP Reminder: The multi-selection is not available for the "classic" Table controls.
For a browsing Table or TreeView Table control:
  • the browse mode must be automatic.
  • the column must be linked to a key item.
WINDEVWEBDEV - Server codeReports and QueriesWindows MobilePHPAjaxUser code (UMC) Syntax 2: Seeking an element in the stored value is available for:
  • a Table or TreeView Table control.
  • a browsing control or a control linked to a variable.
  • a single-selection or multi-selection control.
    WEBDEV - Server codePHP Reminder: The multi-selection controls are available in Ajax only. WEBDEV - Server codePHP Reminder: The multi-selection is not available for the "classic" Table controls.

Type of Search

  • Exact-match search: The elements whose value is strictly equal to <Sought Element> are returned by TableSeek. For example:
    // Return all the customers named "Moore" found in "COL_NameColumn"
    TableSeek(COL_NameColumn, "Moore")
  • 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", False)
    For example:
    // Return all customers whose name starts with "SMI"
    TableSeek(COL_NameColumn, "SMI", searchStartsWith)
WINDEVReports and QueriesAndroidiPhone/iPadWindows MobilePHPUser code (UMC)

Browsing table

  • In a browsing table, the following syntax can be used to seek an element in a column:
    TableName = SoughtElement
  • On the browsing tables with direct access, when using TableSeek:
    • the display of the Table control is moved.
    • the returned subscript corresponds to an "approximate" subscript because this type of Table control can manage billions of records.

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, ...).
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
Exemplo
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
De matos AMARILDO
Feb. 05 2016
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
De matos AMARILDO
Jan. 03 2016