ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / Looper functions
  • Use conditions
  • Adding an empty row
  • Row characteristics
  • Sort
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Inserts a row into a Looper control.
Remark: To add elements to the end of a RepeatString Looper control, use the LooperAddLine function.
Example
// Ajout de valeurs dans le champ Zone répétée en 12ème position
LooperInsertLine(ZR_Zone1, 12, Nom, Prénom, NumTel, NumFax)
// Insertion d'informations recherchées dans la base de données
i is int = 1
LooperDeleteAll(ZR_REPETE1)
HReadSeek(Produit, NomProd, "Fenêtre")
WHILE HOut() = False
	LooperInsertLine(ZR_REPETE1, i, Produit.NomProd, Produit.Code)
	HReadNext(Produit, NomProd)
	i ++
END
Syntax

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

LooperInsertLine(<Looper control> [, <Index> [, <Value 1> [... [, <Value N>]]]])
<Looper control>: Control name
Name of the Looper control to be used.
If this parameter is equal to empty string (""), insertion will be performed on the current RepeatString Looper control.
<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, LooperInsertLine is equivalent to LooperAddLine.
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 the 1st attribute of the row to be inserted in the specified Looper control.
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).
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 the Nth attribute of the row to be inserted into the specified Looper control.
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).
If none of these parameters is specified, an empty row will be inserted into the Looper control.
WINDEVReports and QueriesAndroidiPhone/iPadJavaUser code (UMC)

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

LooperInsertLine(<Looper control> [, <Index>])
<Looper control>: Control name
Name of the Looper control to be used.
If this parameter is equal to empty string (""), insertion will be performed on the current RepeatString field.
<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, LooperInsertLine is equivalent to LooperAddLine.
  • If this parameter is 0, the row will be inserted at the first position in the Looper control.
Remarks

Use conditions

LooperInsertLine 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 LooperInsertLine 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:
    // Ajout d'une répétition vide
    LooperInsertLine(ZR_Zone1, 14)
    
    // Puis initialisation des attributs
    AttributNom[14] = "Hobbes"
    AttributPrénom[14] = "Samantha"
    AttributCouleurPrénom[14] = LightRed
    AttributVisibleAdresse[14] = False
  • For a Looper control without attributes:
    // Ajout d'une répétition vide
    LooperInsertLine(ZR_Zone1, 14)
    
    // Puis initialisation des champs
    ZR_Zone1[14].ChampNom = "Hobbes"
    ZR_Zone1[14].ChampPrénom = "Samantha"
    ZR_Zone1[14].ChampPrénom.CouleurFond = LightRed
    ZR_Zone1[14].ChampAdresse.Visible = False

Row characteristics

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

Sort

LooperInsertLine ignores the sort.
Component: wd300obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/24/2024

Send a report | Local help