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
  • 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 the current row
  • Content of a specific row
  • Positioning on a specific row
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
WINDEV, WINDEV Mobile and WEBDEV allow you to manipulate a RepeatString Looper control directly by 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.
  • handle each control found in the looper:
    <Looper name>[<Index>].<Control name>.<Property name> = <Value>

  • handle each control found in all the looper rows:
    <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: ZR_Client[8].SAI_NomClient = "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: ZR_Client.SAI_NomClient = "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:
    ZR_Client[8].SAI_ClientName.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: ZR_Client[8].SAI_AdresseClient.Largeur += 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 present in the "Line display" event of the RepeatString 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: ResNomClient = ZR_Client[8].SAI_NomClient
    // 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: ResNomClient = ZR_Client.SAI_NomClient
    // 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 = ZR_Customer[8].SAI_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: ResLargeur = ZR_Client[8].SAI_AdresseClient.Largeur
  • 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 = ZR_Customer.SAI_CustomerAddress.Width
Retrieving the value of the different controls/attributes of a row found in a Looper control

Content of the current row

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

Content of a specific row

To retrieve the contents of the row whose index is <Index>:
<Value> = <Looper name>[<Index>]
The result is a character string containing:
  • WINDEV MobileAndroid 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: 09/30/2024

Send a report | Local help