ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / Looper functions
  • Use conditions
  • Case sensitivity
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
LooperSearch (Function)
In french: ZoneRépétéeCherche
Warning
From version 27, LooperSeek is kept for backward compatibility. This function has been replaced with LooperSearch.
Searches for a value in an attribute of a Looper control.
Note: To search all the attributes of a RepeatString Looper control, use the LooperSearchEverywhere function..
Example
// Compte les noms commençant par "DUP" 
// Le premier
Indice is int = LooperSearch(ATT_NOM, "DUP", False)
Cpt is int = 0
WHILE Indice <> -1
	Cpt++
	// Suivant
	Indice = LooperSearch(ATT_NOM, "DUP", False, Indice + 1)
END
Info("Il y a " + Cpt + " noms commençant par 'DUP'")
// Recherche la position du client n°1234
Indice is int = LooperSearch(ATT_IDCLIENT, "1234")
// Si on a trouvé ce client
IF Indice <> -1 THEN
	// Positionne le champ Zone répétée sur le client trouvé
	ZR_ZONE1 = Indice
	// Récupère le nom du client (ATT_NOM est un "attribut" de ZR_ZONE1) 
	// et l'affecte dans un champ Libellé
	LIB_LIBELLE1 = " Informations sur " + ATT_NOM
END
Syntax
<Result> = LooperSearch(<Attribute> , <Search value> [, <Type of search> [, <Start>]])
<Result>: Integer
  • Index of the element found,
  • -1 if the search failed.
<Attribute>: Character string
Attribute of the Looper control on which the search must be performed.
If this parameter corresponds to an empty string (""), the search is performed on the attribute to which the current event belongs.
<Search value>: Character string
Value sought in the specified attribute.
<Type of search>: Optional Integer constant
Type of search to perform:
searchContainsGeneric search of type "Contains"
The index of the elements containing <Sought value> is returned.
searchExactMatch (or True for compatibility)
(Default value)
Exact-match search ("Equals to")
The index of the elements whose value is strictly equal to <Sought value> is returned.
searchStartsWith (or False for compatibility)Generic search whose type is "Starts with"
The index of the elements whose value starts with <Sought value> is returned.
<Start>: Optional integer
Start index for the search (1 by default).
Remarks

Use conditions

LooperSearch can be used on:
  • a Looper control based on a data file,
  • a Looper control populated programmatically.
WEBDEV - Browser code This function is not available for Linear Looper controls. This function is available for Looper controls in browser mode only.
WEBDEV - Server codePHP This function is available for Looper controls in AJAX mode, Looper controls in classic mode and Linear Looper controls.

Case sensitivity

The search is not case sensitive, even if the search is an exact-match search.
Business / UI classification: UI Code
Component: wd300obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help