ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Looper control
  • Overview
  • Initializing the different controls/attributes of a Looper control
  • Retrieving the value of the different controls/attributes found in a Looper control
  • Retrieving the value of the different controls/attributes of a row found in a Looper control
  • Content of current row
  • Content of specific row
  • Positioning on a specific row
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
Overview
WINDEV, WINDEV Mobile and WEBDEV allow you to handle a Looper control through programming. To do so, use the variable of the Looper control in the code.
The variable of the Looper control corresponds to the name of the Looper control. This variable is an integer.
Initializing the different controls/attributes of a Looper control
To initialize the different controls/attributes of a Looper control:
  • use LooperAdd or LooperAddLine.
  • use each looper control:
    <Looper name>[<Index>].<Control name>.<Property name> = <Value>

  • use all the looper rows in each control:
    <Looper name>.<Control name>.<Property name> = <Value>

    If <Property name> corresponds to Value, only the value of the control specified for the current row is modified.
  • handle each attribute of the Looper control:
    <Attribute name>[<Index>] = <Value>
  • handle each attribute of the Looper control for the current row:
    <Attribute name> = <Value>
For example:
  • Change the value of the "EDT_CustomerName" edit control in the "LOOP_Customer" looper control for row #8:
    LOOP_Customer[8].EDT_CustomerName.Value = "Montgomery"
    // Equivalent to: LOOP_Customer[8].EDT_CustomerName = "Montgomery"
    // In WEBDEV, an attribute used to modify the value
    // of "EDT_CustomerName" must exist
  • Change the value of the "EDT_CustomerName" edit control in the "LOOP_Customer" looper control for the current row:
    LOOP_Customer.EDT_CustomerName.Value = "Montgomery"
    // Equivalent to: LOOP_Client.EDT_CustomerName = "Montgomery"
    // In WEBDEV, an attribute used to modify the value
    // of "EDT_CustomerName" must exist
  • Change the background color of the "EDT_CustomerName" edit control in the "LOOP_Customer" looper control for row #8:
    LOOP_Customer[8].EDT_CustomerName.BackgroundColor = DarkBlue
    // In WEBDEV, an attribute used to modify the background color
    // of "EDT_CustomerName" must exist
  • Make the "EDT_CustomerPhone" control invisible in the "LOOP_Customer" looper control for all rows:
    LOOP_Customer.EDT_CustomerPhone.Visible = False
    // In WEBDEV, an attribute used to modify the visibility
    // of "EDT_CustomerPhone" must exist
  • Modify the width of the "EDT_CustomerAddress" control linked to the "ATT_WidthAttribute" attribute in the "LOOP_Customer" looper control for row #8:
    ATT_WidthAttribute[8] += 100
    // Equivalent to: LOOP_Customer[8].EDT_CustomerAddress.Width += 100
  • Modify the width of the "EDT_CustomerAddress" control linked to the "ATT_WidthAttribute" attribute in the "LOOP_Customer" looper control for the current row:
    ATT_WidthAttribute += 100
Remark: These lines of code must be in the "Displaying a row" event of Looper control.
Retrieving the value of the different controls/attributes found in a Looper control
To retrieve the value of the different controls/attributes found in a Looper control:
  • handle each control found in the Looper control:
    <Value> = <Looper name>[<Index>].<Control name>.<Property name>

  • handle each control found in the looper for the current row:
    <Value> = <Looper name>.<Control name>.<Property name>

  • handle each attribute of the Looper control:
    <Value> = <Attribute name>[<Index>]
  • handle each attribute of the Looper control for the current row:
    <Value> = <Attribute name>
For example:
  • Find out the value of the "EDT_CustomerName" edit control in the "LOOP_Customer" looper control for row #8:
    ResCustomerName = LOOP_Customer[8].EDT_CustomerName.Value
    // Equivalent to: ResCustomerName = LOOP_Customer[8].EDT_CustomerName
    // In WEBDEV, an attribute used to modify the value
    // of "EDT_CustomerName" must exist
  • Find out the value of the "EDT_CustomerName" edit control in the "LOOP_Customer" looper control for the current row:
    ResCustomerName = LOOP_Customer.EDT_CustomerName.Value
    // Equivalent to: ResCustomerName = LOOP_Customer.EDT_CustomerName
    // In WEBDEV, an attribute used to modify the value
    // of "EDT_CustomerName" must exist
  • Find out the background color of the "EDT_CustomerName" control in the "LOOP_Customer" looper control for row #8:
    ResColor = LOOP_Customer[8].EDT_CustomerName.BackgroundColor
    // In WEBDEV, an attribute used to modify the background color
    // of "EDT_CustomerName" must exist
  • Find out the width of the "EDT_CustomerAddress" control linked to the "ATT_WidthAttribute" attribute in the "LOOP_Customer" looper control for row #8:
    ResWidth = ATT_WidthAttribute[8]
    // Equivalent to: ResWidth = LOOP_Customer[8].EDT_CustomerAddress.Width
  • Find out the width of the "EDT_CustomerAddress" control linked to the "ATT_WidthAttribute" attribute in the "LOOP_Customer" looper control for the current row:
    ResWidth = ATT_WidthAttribute
    // Equivalent to: ResWidth = LOOP_Customer.EDT_CustomerAddress.Width
Retrieving the value of the different controls/attributes of a row found in a Looper control

Content of current row

To retrieve the content of current row:
<Value> = <Looper name>[<Looper name>]
The result is a character string containing:
  • WINDEV MobileUniversal Windows 10 AppAndroidiPhone/iPad each attribute and/or each control separated by TAB.

Content of specific row

To retrieve the content of the row whose index is <Index>:
<Value> = <Looper name>[<Index>]
The result is a character string containing:
  • WINDEV MobileUniversal Windows 10 AppAndroid each attribute and/or each control separated by TAB.
Positioning on a specific row
To position on a specific row, use the following syntax:
<Looper name> = <Index>
For example:
// Add an empty row
LooperAdd(LOOP_Product)
// Position on the empty row
LOOP_Product = LooperCount(LOOP_Product)
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help