PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

This page concerns the 23 + version of WINDEV. Upgrade your version.
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
Sorts the values selected in a Spreadsheet control.
Example
// Sorts the [A2:B5] cells of current worksheet
SpreadsheetSelectPlus(PSHEET_Spreadsheet, "A2", "B5")
SpreadsheetSortSelection(PSHEET_Spreadsheet, asAscending)
// Sorts the entire worksheet
// Selects a cell
PSHEET_Spreadsheet = "A1"
// Sorts all the rows and columns with data below and on the right
SpreadsheetSortSelection(PSHEET_Spreadsheet, asAscending)
IF ErrorOccurred = True THEN
Error(ErrorInfo())
END
// Sorts the selection according to different criteria
// Column A: Ascending sort
// Column B: Descending sort
SpreadsheetSortSelection(PSHEET_Spreadsheet, "A" + TAB + "B" + asDescending)

IF ErrorOccurred = True THEN
Error(ErrorInfo())
END
Syntax

Sorting the selection according to a sort criterion Hide the details

SpreadsheetSortSelection(<Spreadsheet Control> , <Options>)
<Spreadsheet Control>: Control name
Name of Spreadsheet control to use.
<Options>: Integer constant (or combination of constants)
Sort options:
asAscending
(Default value)
Ascending sort.
asDescendingDescending sort.
tccLexicographicOrderSort based on the linguistic order.
tccRespectNumericSort while respecting the order of numeric values.
tccIgnoreAccentSort while ignoring the accented characters.
tccIgnoreCaseSort while ignoring the case.
tccIgnoreSpaceSort while ignoring the space characters found at the beginning and end of strings.
tccIgnoreInsideSpaceSort while ignoring the space characters found inside the strings.
tccIgnorePonctuationAndSpaceSort while ignoring the space and punctuation characters.

Sorting the selection according to several sort criteria Hide the details

SpreadsheetSortSelection(<Spreadsheet Control> , <Criteria>)
<Spreadsheet Control>: Control name
Name of Spreadsheet control to use.
<Criteria>: Character string
Sort criteria in the following format:
"<Name Column1>[;< Option>]" + TAB + "<Name Column2>[;< Option>]" + TAB + ...
where:
  • <Name Column> corresponds to the name of column to sort.
  • <Option> corresponds to a constant (or to a combination of constants) used to define the sort that will be applied to the column. If this parameter is not specified, the asAscending constant will be used. This parameter can correspond to:
    asAscending
    (Default value)
    Ascending sort.
    asDescendingDescending sort.
    tccLexicographicOrderSort based on the linguistic order.
    tccRespectNumericSort while respecting the order of numeric values.
    tccIgnoreAccentSort while ignoring the accented characters.
    tccIgnoreCaseSort while ignoring the case.
    tccIgnoreSpaceSort while ignoring the space characters found at the beginning and end of strings.
    tccIgnoreInsideSpaceSort while ignoring the space characters found inside the strings.
    tccIgnorePonctuationAndSpaceSort while ignoring the space and punctuation characters.
Remarks
  • The sort is performed on the current selection.
  • If a single cell is selected, the function searches for the best selection: all the rows and columns with data below and on the right.
  • If no sort can be performed, the ErrorOccurred variable is set to True and the error details are returned by ErrorInfo.
  • The first column is used as sort criterion.
  • The sort can be canceled by the user via CTRL+Z.
Components
WINDEVReports and Queries wd230obj.dll
Minimum required version
  • Version 23
This page is also available for…
Comments
Click [Add] to post a comment