PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • 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
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).
Example
// Sort according to one of the Looper control attributes selected in a Radio Button control
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 control on all its attributes (in descending order)
LooperSort("-LOOP_Customer")
// Cancels the sort that was performed in the LOOP_Customer Looper control
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.

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.

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 Programmed browse ("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, etc.).
Component : wd240obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment