PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Updating the data file linked to the Looper control
  • Cascading input and update of linked data file
  • Re-displaying the row that was saved
  • Locking and updating the data file
  • Duplicates and referential integrity
  • Using LooperSave to reduce the number of code lines
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
LooperSave (Function)
In French: ZoneRépétéeEnregistre
Validates the modification or addition of the record associated with the current row in the browsing Looper control. The record is updated in the data file linked to the browsing Looper control.
Versions 16 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
New in version 16
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Example
// Save "LOOP_ProductLooper"
LooperSave(LOOP_ProductLooper)
Syntax
LooperSave(<Looper Control>)
<Looper Control>: Control name
Name of Looper control to use. The current row found in this Looper control will be saved.
If this parameter corresponds to an empty string (""), the Looper control to which the current process belongs will be used.
Remarks

Updating the data file linked to the Looper control

LooperSave saves the current row of Looper control in the data file linked to the Looper control. The items are automatically assigned with the values of associated controls in the current row.
When a modification is performed, LooperSave replaces the former values by the new ones. The items not found in the Looper control are not modified.
Caution:
  • LooperSave 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 LooperSave. To modify the content of the memo associated with the image (rare case), use HLinkMemo.

Cascading input and update of linked data file

If the cascading input is enabled, the data file linked to the browsing Looper control is automatically modified when the user goes to the next row (LooperAdd, LooperAddLine, LooperInsert, LooperInsertLine, LooperModify and LooperModifyLine). LooperSave is useless.
If the cascading input is not enabled, the data file linked to the browsing Looper control is not modified. To write the added row or the modified row into the linked data file, LooperSave must be called after the function used to perform the addition or the modification.
Notes:

Re-displaying the row that was saved

After the call to LooperSave, the row saved 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 LooperDisplay.

Locking and updating the data file

If the data file is locked in the current process, LooperSave saves the current row and unlocks the data file.

Duplicates and referential integrity

  • If the management of duplicates is enabled (HSetDuplicates), HErrorDuplicates must be checked after the execution of LooperSave to check the key uniqueness.
  • If the management of referential integrity is enabled (HSetIntegrity), HErrorIntegrity must be checked after the execution of LooperSave to check the referential integrity.

Using LooperSave to reduce the number of code lines

LooperSave is used to reduce the number of code lines. This single line allows you to avoid assigning the item variables one by one.
For example, the following code:
Customer.Name = ATT_Name
Customer.FirstName = ATT_FirstName
Customer.Address = ATT_Address
Customer.ZC = ATT_ZC
Customer.City = ATT_City
HAdd(Customer)
is replaced by the following line:
LooperSave(LOOP_CustomerLooper)
Components
WINDEVReports and Queries wd230obj.dll
Windows Mobile wp230obj.dll
Java wd230java.jar
Linux wd230obj.so
Minimum required version
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment