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
  • Sort
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
Inserts a row into a Looper control.
Remark: To add elements at the end of Looper control, use <Looper>.AddLine.
Example
// Add values into the Looper control at position 12
LOOP_Looper1.InsertLine(12, LastName, FirstName, PhoneNum, FaxNum)
// Insert searched information into the database
i is int = 1
LOOP_LOOPER1.DeleteAll()
HReadSeek(Product, ProdName, "Window")
WHILE HOut() = False
LOOP_LOOPER1.InsertLine(i, Product.ProdName, Product.Code)
HReadNext(Product, ProdName)
i ++
END
Syntax

Inserting a row in a Looper control with attributes Hide the details

<Looper control>.InsertLine([<Index> [, <Value 1> [, <Value N>]]])
<Looper control>: Control name
Name of the Looper control to be used.
<Index>: Optional integer
Index of the row from which the new row will be inserted.
Index not specifiedThe row will be inserted before the current row. If no row is selected, the row will be inserted at the last position in the Looper control.
Index greater than the number of rows in the controlThe row will be inserted at the last position in the Looper control. In this case, <Looper>.InsertLine is equivalent to <Looper>.AddLine.
Index equal to 0The row will be inserted at the first position in the Looper control.
Index equal to -1The row will be inserted before the current row. If no row is selected, the row will be inserted at the last position in the Looper control.
<Value 1>: Type of associated attribute (optional)
Value of 1st attribute for the row to insert into the specified Looper control.
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).
If none of these parameters is specified, an empty row will be inserted into the Looper control.
<Value N>: Type of associated attribute (optional)
Value of N attribute for the row to insert into the specified Looper control.
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).
If none of these parameters is specified, an empty row will be inserted into the Looper control.
WINDEVReports and QueriesUniversal Windows 10 AppAndroidiPhone/iPadJavaUser code (UMC)

Inserting a row in a Looper control without attributes Hide the details

<Looper control>.InsertLine([<Index>])
<Looper control>: Control name
Name of the Looper control to be used.
<Index>: Optional integer
Index of the row from which the new row will be inserted.
  • If this parameter is not specified or is equal to -1, the row will be inserted before the current row. If no row is selected, the row will be inserted at the end of the Looper control.
  • If <Index> is greater than the number of rows, the row will be inserted at the last position in the Looper control. In this case, <Looper>.InsertLine is equivalent to <Looper>.AddLine.
  • If this parameter is 0, the row will be inserted at the first position in the Looper control.
Remarks

Use conditions

<Looper>.InsertLine 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>.InsertLine can only be used in 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.InsertLine(14)
     
    // Then, initialize the attributes
    AttributeLastName[14] = "Hobbes"
    AttributeFirstName[14] = "Samantha"
    AttributeFirstNameColor[14] = LightRed
    AttributeAddressVisible[14] = False
  • For a Looper control without attributes:
    // Add an empty row
    LOOP_Looper1.InsertLine(14)
     
    // Then, initialize the controls
    LOOP_Looper1[14].LastNameControl = "Hobbes"
    LOOP_Looper1[14].FirstNameControl = "Samantha"
    LOOP_Looper1[14].ControlFirstName.BackgroundColor = LightRed
    LOOP_Looper1[14].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.InsertLine(10, (53+29), (83-21))

Sort

<Looper>.InsertLine ignores the sort.
Component: wd290obj.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