Sorts the elements found in a TreeView control.
Example of TreeView control:
// Sort the elements found in the "TREE_TVRecipe" TreeView control
// Alphabetical sort from the "Desserts" node
Res = TreeSort(TREE_TVRecipe, "Recipes" + TAB + "Desserts", tvUp)
<Result> = TreeSort(<TreeView control> [, <Path of source element> [, <Type of sort>]])
- True if the sort was performed,
- False if the specified source element does not exist.
After the call to TreeSort
, all the branches of the TreeView control are automatically collapsed.
<TreeView control>: Control name
Name of TreeView control to sort.
<Path of source element>: Optional character string
Full path of element from which the sort will be performed. If this parameter corresponds to the NULL constant or if it is not specified, the sort is performed on all elements found in the TreeView control. This parameter has the following format:
In case of duplicates on a path element, this path can contain the element identifier (specified at the end of its name by TreeID).
"<Root name>" + TAB + ["<Name of 1st node>" + TAB + ...
["<Name of 2nd node>" + TAB + [...]]]"<Leaf name>"
<Type of sort>: Optional constant
Type of sort to perform.
|tvDown||Sort in reverse alphabetical order.|
|Sort in alphabetical order.|
For compatibility with previous versions, both TreeSort and TreeSort_55 are supported.