ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Looper functions
  • Use conditions
  • Adding an empty row
  • Row characteristics
  • Position of the new row
  • Handling a binary memo
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Adds a row at the end of a Looper control.
Warning
It is recommended to use <Looper>.AddLine. <Looper>.AddLine allows you to add:
  • TAB characters into the attributes/controls.
  • all types of values into the attributes/controls.
Example
// Initialize the Looper control named LOOP_LOOPER1 
LOOP_LOOPER1.DeleteAll() 
HReadFirst(Product, ProdName) 
WHILE HOut() = False
	LOOP_LOOPER1.Add(Product.ProdName + TAB + Product.ProductCode) 
	HReadNext(Product, ProdName) 
END
// Add an empty row 
LOOP_Looper1.Add() 
// Position on the empty row 
Index = LOOP_Looper1.Count() 
// Then, initialize the attributes 
ATT_AttributeLastName[Index] = "Hobbes"
ATT_AttributeFirstName[Index] = "Samantha"

// Or initialize the controls
// LOOP_Looper1[Index].ControlLastName = "Hobbes"
// LOOP_Looper1[Index].ControlFirstName = "Samantha"
Syntax

Adding a row to a Looper control with attributes Hide the details

<Result> = <Looper control>.Add([<Value>])
<Result>: Boolean
  • True if the addition was successful,
  • False otherwise.
<Looper control>: Control name
Name of the Looper control to be used.
<Value>: Optional character string
List of values that will be inserted into the new row. This parameter must have the following format:
<Value 1> + TAB + ... + <Value N>

The different values must be specified in the order of the attributes (Looper control description window).
If you don't want to specify a value for one of the attributes, use an empty string ("") or 0 (depending on the attribute type).
An empty row will be added if this parameter corresponds to an empty string ("").
Reports and Queries

Adding a row to a Looper control without attributes Hide the details

<Result> = <Looper control>.Add()
<Result>: Boolean
  • True if the addition was successful,
  • False otherwise.
<Looper control>: Control name
Name of the Looper control to be used.
Remarks

Use conditions

<Looper>.Add can be used on:
  • a Looper control based on a data file,
  • a Looper control populated programmatically.

Adding an empty row

After adding an empty row, each attribute or control must be initialized individually.
For example:
  • For a Looper control with attributes:
    // Add an empty row
    LOOP_Looper1.Add()
    
    // Position on the empty row
    Index = LOOP_Looper1.Count()
    // Then, initialize the attributes
    ATT_AttributeLastName[Index] = "Hobbes"
    ATT_AttributeFirstName[Index] = "Samantha"
    ATT_ColorAttributeFirstName[Index] = LightRed
    ATT_AttributeAddressVisible[Index] = False
  • For a Looper control without attributes:
    // Add an empty row
    LOOP_Looper1.Add()
    
    // Position on the empty row
    Index = LOOP_Looper1.Count()
    // Then, initialize the controls
    LOOP_Looper1[Index].ControlLastName = "Hobbes"
    LOOP_Looper1[Index].ControlFirstName = "Samantha"
    LOOP_Looper1[Index].ControlFirstName.BackgroundColor = LightRed
    LOOP_Looper1[Index].ControlAddress.Visible = False

Row characteristics

If a value is the result of a calculation, enclose the numerical expression in brackets. For example:
LOOP_CalclulationZone.Add((53+29) + TAB + (83-21))

Position of the new row

By default, the row is added at the end of the Looper control.
If the Looper control is sorted (<Looper>.Sort), the added row is positioned in the Looper control according to the current sort.

Handling a binary memo

To add a binary memo into a Looper control, use <Looper>.AddLine.
Component: wd300obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/26/2024

Send a report | Local help