ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Looper functions
  • Use conditions
  • Characteristics of the row
  • Handling a binary memo
  • 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: It is recommended to use LooperInsertLine. Indeed, LooperInsertLine allows you to insert:
  • TAB characters into the attributes/controls.
  • all types of values into the attributes/controls.
WINDEVWINDEV Mobile For the Looper controls without attributes, we recommend that you use LooperInsertLine.
Example
// Initialize the Looper control named LOOP_LOOPER1
LooperDeleteAll(LOOP_LOOPER1)
HReadFirst(Product, ProdName)
WHILE HOut() = False
LooperInsert(LOOP_LOOPER1, Product.ProdName + TAB + Product.Code)
HReadNext(Product, ProdName)
END
// Add values into the Looper control at position 12
LooperInsert(LOOP_Looper1, LastName + TAB + FirstName + TAB + PhoneNum + TAB + FaxNum, 12)
Syntax
<Result> = LooperInsert(<Looper control> , <Value> [, <Index>])
<Result>: Boolean
  • True if the addition was successful,
  • False otherwise.
<Looper control>: Control name
Name of the Looper control to be used.
If this parameter is an empty string (""), the row will be added in the current Looper control.
<Value>: Character string
List of values that will be inserted into the new row. This parameter must have the following format:
<Value 1> + TAB + ... + <Value N>

The different values must be specified in the order of the attributes (Looper control description window).
To specify no value for an attribute, use an empty string ("") or 0 (depending on the type of the attribute).
<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, LooperInsert is equivalent to LooperAdd.
  • If this parameter is 0, the row will be inserted at the first position in the Looper control.
Remarks

Use conditions

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

Characteristics of the row

If a value corresponds to the result of a calculation, the numeric expression must be enclosed in brackets. For example:
LooperInsert(LOOP_CalculationZone, (53+29) + TAB + (83-21), 12)

Handling a binary memo

To insert a binary memo into a Looper control, use LooperInsertLine.

Sort

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

Last update: 06/22/2023

Send a report | Local help