ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / Properties associated with windows, pages and controls
  • 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 gets and sets the sort options used in:
  • text columns in Table controls,
  • text columns in TreeView Table controls,
  • List Box and ListView controls,
  • Combo Box controls,
  • WEBDEV - Server code attributes of Looper controls,
  • WEBDEV - Server code images, clickable images and thumbnails with automatic sequence.
This property can only be used on controls populated programmatically. It is not available for controls based on a data file. These sort options can be defined in the window editor or in the page editor, in the "Details" tab of the control description.
Example
// Sorts a list while respecting the numeric order
LIST_Turnover.SortOption = ccRespectNumeric
Syntax

Getting the sort options used Hide the details

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

Changing 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:
ccIgnoreAccentSorts text while ignoring accents
ccIgnoreCaseSorts text while ignoring the case (uppercase/lowercase characters)
ccIgnorePunctuationAndSpaceSorts text while ignoring punctuation and spaces (for more details, see the Notes)
ccIgnoreSpaceSorts text while ignoring leading and trailing spaces in the strings
ccLexicographicOrderSorts the strings in lexicographical order (for example, 'é' is between 'e' and 'f')
ccNormal
(Default value)
Standard comparison, similar to the = operator
ccRespectNumericSorts text while taking into account the numeric values within the strings (e.g., "10" comes after "9").
sortDefault (cannot be combined)Performs a case-insensitive and accent-insensitive sort. Ignores spaces
sortWithoutFunctionGxxxSorts text while ignoring gImage, gStoredValue, etc., ... By default, these elements are taken into account for 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 Table or TreeView Table controls, 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

Last update: 04/06/2023

Send a report | Local help