ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Looper functions
  • Use conditions
  • Adding an empty row
  • Characteristics of the row
  • Position of the new row
  • Tips
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Adds a row at the end of a Looper control. The attributes of the new row may contain tabulations.
Example
// Initialize the Looper control named LOOP_LOOPER1
LOOP_LOOPER1.DeleteAll()
HReadFirst(Product, ProdName)
WHILE HOut(Product) = False
LOOP_LOOPER1.AddLine(Product.ProdName, Product.Code)
HReadNext(Product, ProdName)
END
Syntax

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

<Result> = <Looper control>.AddLine([<Value 1> [... [, <Value N>]]])
<Result>: Integer
  • Number of the added row,
  • 0 if an error occurs.
<Looper control>: Control name
Name of the Looper control to be used.
<Value 1>: Type of associated attribute (optional)
Value of 1st attribute for the new row.
The different values must be specified in the order of the attributes (Looper control description window).
To specify no value for one of the attributes, use an empty string ("") or 0 (depending on the type of attribute).
An empty row will be added if none of these parameters is specified.
<Value N>: Type of associated attribute (optional)
Value of Nth attribute for the new row.
The different values must be specified in the order of the attributes (Looper control description window).
To specify no value for one of the attributes, use an empty string ("") or 0 (depending on the type of attribute).
An empty row will be added if none of these parameters is specified.
WINDEVReports and QueriesUniversal Windows 10 AppAndroidJavaUser code (UMC)

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

<Result> = <Looper control>.AddLine()
<Result>: Integer
Number of the added row.
<Looper control>: Control name
Name of the Looper control to be used.
Remarks

Use conditions

<Looper>.AddLine 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.
PHP <Looper>.AddLine can only be used on a Looper control populated programmatically.

Adding an empty row

After adding an empty row, each attribute or control must be initialized individually.
For example:
WINDEVWEBDEV - Server code For a Looper control with attributes:
// Add an empty row
Index = LOOP_LOOPER1.AddLine()
 
// Then, initialize the attributes
ATT_AttributeLastName[Index] = "Hobbes"
ATT_AttributeFirstName[Index] = "Samantha"
ATT_ColorAttributeFirstName[Index] = LightRed
ATT_AttributeAddressVisible[Index] = False
WINDEVWEBDEV - Server code For a Looper control without attributes:
// Add an empty row
Index = LOOP_Looper1.AddLine()
 
// 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

Characteristics of the row

  • If a value corresponds to the result of a calculation, the numeric expression must be enclosed in brackets.
    For example:
    LOOP_CalculationZone.AddLine((53+29), (83-21))
  • Formatting attributes (e. g. color) that are not specified in the row display code are automatically reset.

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.
WEBDEV - Server code

Tips

  • Optimizing the referencing:
    If the Looper control contains an image, add an "Alternative text" attribute. Its value can be defined by programming so that the referencing of your Internet site will be improved.
  • Active WEBDEV Page with a Looper control containing images to display in 100% mode:
    In order for the 100% property to be taken into account, a border must be added to the Image control. To avoid displaying this border, the background color of the border must be identical to the background color of the page.
Component: wd300obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/22/2023

Send a report | Local help