|  | 
 | ||||
|        | |||||
|  | ||||||
| Related Topics | Other Library Functions | |||||
| function | sort.sort-by-value | 
| Library: Sorting (OMSORT) Import: omsort.xmd | 
define overloaded function sort.sort-by-value modifiable integer shelf-to-sort define overloaded function sort.sort-by-value modifiable stream shelf-to-short
Argument definitions
Use sort.sort-by-value to sort a shelf of integers or streams by their values in ascending order.
This example sorts a list of integers:
  import "omsort.xmd" prefixed by sort.
  process
     local integer integer-list variable initial {1,3,2}
     sort.sort-by-value integer-list
     
     repeat over integer-list
       output "d" % integer-list || "%n"
     again
This example sorts a list of stream values:
  import "omsort.xmd" prefixed by sort.
  process
     local stream my-stream variable initial
        {"foo", "bar", "sna"}
  
     sort.sort-by-value my-stream
     
     repeat over my-stream
        output my-stream || "%n"
     again
If shelf-to-sort is a stream shelf, then it must
| Related Topics | Other Library Functions 
 | 
Copyright © Stilo International plc, 1988-2010.