ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Looper control
  • Overview
  • RepeatString field linked to a data file and automatically initialized
  • RepeatString field linked to a data file and initialized by programming
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Looper control linked to a data file
Overview
A Looper control can be used to display the content of a data file or the content of a query.
When a Looper control is linked to a data file or to a query, the looper can be initialized with the content of the data file or with the content of the query:
  • or automatically No specific code is required to initialize the RepeatString Looper control. The options to loop through the data file linked to the control can be defined in the "Content" tab of the control description.
  • or by programming It is necessary to enter the path code of the data file linked to the RepeatString field in the various field processing operations. This method is not recommended.
Note When creating a RepeatString Looper control, the wizard asks for the various information required to create a RepeatString Looper control linked to a data file or query.
RepeatString field linked to a data file and automatically initialized
A RepeatString Looper control linked to a data file can be used to display information from a specific data source (data file, query, etc.).
The content of the control is defined during its creation and it can be modified in its description window ("Content" tab).
This tab is used to define whether the Tab Control is:
  • a RepeatString field linked to a data file,
  • a RepeatString field displaying programmed data
  • a RepeatString Looper control linked to a variable.
In the case of a RepeatString Looper control linked to a data file, this tab is used to determine the characteristics of the data source path:
  • Browsed data file
Data file or query containing the data to display.
  • Stored item (optional)
Item whose value is returned to the program when a row element is selected.
  • Automatic iteration
If this option is checked, WINDEV, WINDEV Mobile or WEBDEV manage how the data file is looped through and how the data is displayed in the Looper control. No WLanguage code is required.
  • Search item
Item used to loop through the data source. The information displayed in the Looper control will be sorted according to this item.
  • Reverse iteration
The iteration direction depends on the browse item. The iteration direction is defined in the data model editor, in the characteristics of the item.
If this option is checked, the iteration direction used will be the opposite of the one defined in the data model editor.
  • Display the records whose search key starts with:
Condition used to filter the displayed records. This is a "Start with" filter and is applied to the browse item. To implement more complex filters, use HFilter.
RepeatString field linked to a data file and initialized by programming
If you use a RepeatString field linked to a data file with programmed initialization, it is necessary to enter the path code of the data file in the various events associated with the field. This method is not recommended and is only kept for backward compatibility.
For example Initialization of a Looper control RepeatString with products from the data file Product.
// The LOOP_LOOPER1 Looper control contains 5 captions and an image
// 6 attributes are used to modify the value of captions and the image displayed
// Initialize the looper from the content of an HFSQL data file
HReadFirst(Product, ProductName)
WHILE NOT HOut()
	LooperAdd(LOOP_LOOPER1, Product.ProductName + TAB + Product.Duration + ...
					TAB + Product.Director + TAB + Product.Actor + ...
					TAB + Product.Photo + TAB + Product.Designation)
	HReadNext(Product, ProductName)
END
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/08/2025

Send a report | Local help