ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Looper functions
  • Updating the data file linked to the Looper control
  • Cascading input and update of linked data file
  • Re-displaying the saved row
  • Locking and updating the data file
  • Duplicates and referential integrity
  • Use <Looper>.Save to reduce the number of lines of code
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
<Looper>.Save (Function)
In french: <Zone répétée>.Enregistre
Validates the modification or addition of the record associated with the current row in the Looper control.. The record is updated in the data file linked to the Looper control.
Example
// Save the data of the Looper control "LOOP_ProductLooper"
LOOP_ProductLooper.Save()
Syntax
<Looper control>.Save()
<Looper control>: Control name
Name of the Looper control to be used. The current row of this Looper control will be recorded in the linked data file.
Remarks

Updating the data file linked to the Looper control

<Looper>.Save saves the current row of the Looper control to the data file. The items are automatically assigned with the values of associated controls in the current row.
When a modification is performed, <Looper>.Save replaces the former values by the new ones. The items not found in the Looper control are not modified.
Caution:
  • <Looper>.Save only supports the data file associated with the Looper control. If some attributes/controls are linked to items found in other data files, these data files are not automatically managed.
  • The "Image" attributes/controls are not saved by <Looper>.Save. To modify the content of the memo associated with the image (rare case), use <Source>.LinkMemo.

Cascading input and update of linked data file

If cascading input is enabled, changes are automatically applied in the data file linked to the Looper control when the user moves to the next row <Looper>.Add, <Looper>.AddLine, <Looper>.Insert, <Looper>.InsertLine, <Looper>.Modify and <Looper>.ModifyLine). <Looper>.Save is useless.
If cascading input is not enabled, changes are not applied in the data file linked to the Looper control. To write the added row or the modified row into the linked data file, <Looper>.Save must be called after the function used to perform the addition or the modification.
Remarks:

Re-displaying the saved row

After the call to <Looper>.Save, the saved row may "disappear". This "disappearance" is due to the value of the search key for the added or modified record.
To avoid this problem, redisplay the Looper control with <Looper>.Display.

Locking and updating the data file

If the data file is locked in the current process, <Looper>.Save saves the current row and unlocks the data file.

Duplicates and referential integrity

Use <Looper>.Save to reduce the number of lines of code

<Looper>.Save reduces several lines of code. This single line allows you to avoid assigning the item variables one by one.
For example, the following code:
Customer.LastName = ATT_LastName
Customer.FirstName = ATT_FirstName
Customer.Address = ATT_Address
Customer.ZC = ATT_ZC
Customer.City = ATT_City
Customer.Add()
is replaced with the following line:
LOOP_CustomerLooper.Save()
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