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
  • Sort
  • Looper bound to a data source and using a programmed iteration
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
<Looper>.Sort (Function)
In french: <Zone répétée>.Trie
Allows sorting a Looper control according to one or more of its attributes.
Example
// Tri selon un des attributs du champ Zone répétée choisi dans un champ Sélecteur
SWITCH SEL_SELECT1
	CASE 1: ZR_Client.Trie("NOM")
	CASE 2: ZR_Client.Trie("SOCIETE")
	CASE 3: ZR_Client.Trie("VILLE")
END
Syntax

Sorting a Looper control according to a list of attributes Hide the details

<Result> = <Looper control>.Sort(<List of attributes>)
<Result>: Boolean
  • True if the sort was performed,
  • False otherwise.
<Looper control>: Control name
Name of the Looper control to be used.
<List of attributes>: Character string
Name of the attributes according to which the Looper control will be sorted (up to 10 attributes). This character string must have the following format:
"[<Sens>]<Attribut 1>" + TAB + "[<Sens>]<Attribut 2>" + TAB + ...
with:
  • : sorting direction (optional), can take the following values:
    • "+": sorting will be ascending (default value).
    • "-": sorting will be in descending order.
  • : name of the attribute used for sorting.
Remarks

Use conditions

<Looper>.Sort can be used on:
  • a Looper control based on a data file,
  • a Looper control populated programmatically.

Sort

The sort will be taken into account during the next addition of a row into the Looper control (<Looper>.Add, <Looper>.AddLine, <Looper>.Insert and <Looper>.InsertLine).

Looper bound to a data source and using a programmed iteration

<Looper>.Sort does not work on a Looper control with the following characteristics:
  • Looper control bound to a data source,
  • Looper control that uses Browse programmatically ("Content" tab in the control description window).
To change the display order of a Looper control with programmed iteration, you must adapt the code found in the different read processes of the Looper control (process for reading the first one, the next one, the previous one, ...).
Component: wd300obj.dll
Minimum version required
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/24/2024

Send a report | Local help