PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

  • Taking the sort order into account
  • Characters taken into account for punctuation and spaces
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
The SortOption property is used to get and change the sort options used in:
  • the text columns found in Table controls,
  • the text columns found in TreeView Table controls,
  • the List Box and ListView controls,
  • the Combo Box controls,
  • Versions 15 and later
    WEBDEV - Server code the attributes of Looper controls,
    New in version 15
    WEBDEV - Server code the attributes of Looper controls,
    WEBDEV - Server code the attributes of Looper controls,
  • Versions 16 and later
    WEBDEV - Server code the images, the clickable images and the thumbnails with automatic scroll.
    New in version 16
    WEBDEV - Server code the images, the clickable images and the thumbnails with automatic scroll.
    WEBDEV - Server code the images, the clickable images and the thumbnails with automatic scroll.
This property can only be used on the "memory" controls. It is not available for the "browsing" controls. These sort options can be defined in the window editor or in the page editor, in the "Details" tab of control description.
Example
// Sorts a list while respecting the numeric order
LIST_Turnover.SortOption = ccRespectNumeric
Syntax

Finding out the sort options used Hide the details

<Sort options> = <Control used>.SortOption
<Sort options>: Integer constant
Sort option currently applied:
ccLexicographicOrderSorts the strings in lexicographical order (for example, 'é' is between 'e' and 'f')
ccNormal
(Default value)
Standard comparison, similar to the = operator
ccRespectNumericSorts elements while taking into account the numeric values inside the strings (in this case, "10" comes after "9").
ccIgnoreAccentSorts elements while ignoring accents
ccIgnoreCaseSorts elements while ignoring the case (uppercase/lowercase characters)
ccIgnoreSpaceSorts elements while ignoring leading and trailing spaces in the strings
ccIgnorePunctuationAndSpaceSorts elements while ignoring punctuation and spaces (for more details, see the Notes)
sortDefaultPerforms a case-insensitive and accent-insensitive sort. Ignores spaces
sortWithoutFunctionGxxxSorts elements while ignoring gImage, gStoredValue, etc., ... By default, these elements are taken into account by the sort.
<Control used>: Control name
Name of the control to be used.

Modifying the sort options Hide the details

<Control used>.SortOption = <Sort options>
<Control used>: Control name
Name of the control to be used.
<Sort options>: Combination of Integer constants
Sort option that will be applied to the control:
ccLexicographicOrderSorts the strings in lexicographical order (for example, 'é' is between 'e' and 'f')
ccNormal
(Default value)
Standard comparison, similar to the = operator
ccRespectNumericSort while taking into account the numeric values inside the strings (in this case, "10" comes after "9").
ccIgnoreAccentSort while ignoring the accented characters
ccIgnoreCaseSort while ignoring the case (uppercase/lowercase characters)
ccIgnoreSpaceSort while ignoring the space characters found before and after the character strings
ccIgnorePunctuationAndSpaceSort while ignoring the punctuation and the space characters (for more details, see the Notes)
sortDefault (cannot be combined)Performs a case-insensitive and accent-insensitive sort. Ignores spaces
sortWithoutFunctionGxxxSorts elements while ignoring gImage, gStoredValue, etc., ... By default, these elements are taken into account by the sort.
Remarks

Taking the sort order into account

  • For List and Combo Box controls, the sort order specified with the SortOption property is applied immediately.
  • For columns in tables or TreeView Tables, TableSort must be called to apply the specified sort order. For example:
    COL_Name.SortOption = ccLexicographicOrder
    TableSort(TABLE_Name, "+COL_Name")

Characters taken into account for punctuation and spaces

The characters taken into account for punctuation and spaces are provided by the system. To get the list of these characters, write the following WLanguage code:
s is string
FOR i = 0 TO 255
IF Charact(i) <> StringFormat(Charact(i), ccIgnorePunctuationAndSpace) THEN
 s += Charact(i)
END
END
Info(s)
ToClipboard(s)
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment