SORT LIST

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 6.0


SORT LIST (list{; > or <})

ParameterTypeDescription
listListRefList reference number
> or <Sorting order:
> to sort in ascending order, or
< to sort in descending order

Description

The SORT LIST command sorts the list whose reference number is passed in list.

To sort in ascending order, pass >. To sort in descending order, pass <. If you omit the sorting order parameter, SORT LIST sorts in ascending order by default.

SORT LIST sorts all levels of the list; it first sorts the items of the list, then it sorts the items in each sublist (if any), and so on, through all the levels of the list. This is why you will usually apply SORT LIST to a list in a form. Sorting a sublist is of little interest because the order will be changed by a call to a higher level.

SORT LIST does not change the current list item nor the current expanded/collapsed state of the list and sublists. However, because the current item can be moved by the sorting operation, Selected list items may return a different position before and after the sort.

Example

Given the list named hList, shown here in the User environment (in Macintosh appearance):

After the execution of this code:

      ` Sort the list and it sublists in ascending order
   SORT LIST(hList;>)
   REDRAW LIST(hList) ` Do NOT forget to call REDRAW LIST otherwise the list won't be updated

The list looks like:

After the execution of this code:

      ` Sort the list and it sublists in ascending order
   SORT LIST(hList;<)
   REDRAW LIST(hList) ` Do NOT forget to call REDRAW LIST otherwise the list won't be updated


The list looks like:

See Also

Selected list items.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next