PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Use conditions
  • Canceling the sort
  • Sort
  • Looper linked to a data source and using a programmed browse
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
LooperSort (Function)
In French: ZoneRépétéeTrie
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 the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 16 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 16
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Universal Windows 10 App This function is now available for the Windows Phone applications.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Universal Windows 10 App This function is now available for the Windows Phone applications.
Versions 17 and later
iPhone/iPad This function is now available for the 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 the iPhone/iPad applications.
WEBDEV - Browser code This function is now available in Browser code.
iPhone/iPad This function is now available for the 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
// Sort according to one of the looper attributes selected in a radio button
SWITCH RADIO_RADIO1
        CASE 1: LooperSort("NAME")
        CASE 2: LooperSort("COMPANY")
        CASE 3: LooperSort("CITY")
END
// Sort by name (in ascending order) and by date (in descending order)
LooperSort("NAME" + TAB + "-DATE")
// Sort the LOOP_Customer looper on all its attributes (in descending order)
LooperSort("-LOOP_Customer")
// Cancels the sort that was performed in the LOOP_Customer looper
LooperSort("LOOP_Customer", 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 (with quotes)
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:
[<Direction>]<Attribute 1> + TAB + [<Direction>]<Attribute 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 (with quotes)
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 the linear Looper controls. This function is available for the Browser Looper controls only.
WEBDEV - Server codePHP This function is available for the Ajax Looper controls and for the Classic 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

LooperSort does not operate on a Looper control with the following characteristics:
  • Looper control linked to a data source,
  • Looper control that uses the programmed browse option.
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...).
Components
WINDEVReports and Queries wd230obj.dll
WEBDEV - Server code wd230page.dll
Windows Mobile wp230obj.dll
WEBDEV - Browser code WDJS.DLL
Java wd230java.jar
Linux wd230obj.so
Android wd230android.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment