PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • Use conditions
  • Canceling the sort
  • Sort
  • Looper linked to a data source and using a programmed browse
  • Previous versions
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
Allows you to:
  • Sort a Looper control according to one or more attributes.
  • Sort a Looper control on all its attributes.
  • Cancel a sort that was performed beforehand (which means ignore the sort).
Versions 15 and later
Android This function is now available for Android applications.
New in version 15
Android This function is now available for Android applications.
Android This function is now available for Android applications.
Versions 16 and later
WINDEVLinux This function is now available for WINDEV applications in Linux.
New in version 16
WINDEVLinux This function is now available for WINDEV applications in Linux.
WINDEVLinux This function is now available for WINDEV applications in Linux.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
WEBDEV - Browser code This function is now available in Browser code.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
WEBDEV - Browser code This function is now available in Browser code.
iPhone/iPad This function is now available for iPhone/iPad applications.
WEBDEV - Browser code This function is now available in Browser code.
Versions 18 and later
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This function is now available in Windows Store apps mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
// Tri selon un des attributs du champ Zone répétée choisi dans un champ Sélecteur
SWITCH SEL_SELECT1
CASE 1: LooperSort("NOM")
CASE 2: LooperSort("SOCIETE")
CASE 3: LooperSort("VILLE")
END
// Tri par nom par ordre croissant et par date par ordre décroissant
LooperSort("NOM" + TAB + "-DATE")
// Tri du champ Zone répétée ZR_Client par ordre décroissant sur tous ses attributs
LooperSort("-ZR_Client")
// Annule le tri précédemment effectué sur le champ Zone répétée ZR_Client
LooperSort("ZR_Client", False)
Syntax

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

<Result> = LooperSort(<List of attributes>)
<Result>: Boolean
  • True if the sort was performed,
  • False otherwise.
<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 + ...
where:
  • <Direction>: sort direction (optional), can take the following values:
    • "+": the sort will be performed in ascending order (default value).
    • "-": the sort will be performed in descending order.
  • <Attribute>: name of the attribute used for the sort.
Versions 17 and later
WEBDEV - Browser code In browser code, the sort can be performed on a single attribute only.
New in version 17
WEBDEV - Browser code In browser code, the sort can be performed on a single attribute only.
WEBDEV - Browser code In browser code, the sort can be performed on a single attribute only.

Sorting a Looper control or canceling a previous sort Hide the details

<Result> = LooperSort([<Direction>]<Looper> [, <Indicator>])
<Result>: Boolean
  • True if the sort was performed or canceled,
  • False otherwise.
<[<Direction>]<Looper>>: Character string
Name of the Looper control to sort.
  • If <Direction> is equal to "+", the Looper control will be sorted in ascending order (by default).
  • If <Direction> is equal to "-", the Looper control will be sorted in descending order.
<Indicator>: Optional boolean
  • True to perform the sort (default value),
  • False to cancel a sort that was performed beforehand.
Remarks

Use conditions

LooperSort can be used on a browsing or memory Looper control.
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.

Canceling the sort

Sort

The sort will be taken into account during the next addition of a row into the Looper control (LooperAdd, LooperAddLine, LooperInsert and LooperInsertLine).

Looper linked to a data source and using a programmed browse

The LooperSort function does not work on an Looper control with the following characteristics:
  • Looper control linked 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 browse, 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, ...).
WEBDEV - Server code

Previous versions

This function replaces the function ZoneRepeatedTri, kept for compatibility with WEBDEV 1.5.
Component: wd270obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment