swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
function  

sort.sort-by-value

 
 

Library: General, Sorting (OMSORT)
Import: omsort.xmd

Declaration

  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

shelf-to-sort
is a shelf of integers or a shelf of streams


Purpose

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

Requirements

If shelf-to-sort is a stream shelf, then it must

    Related Syntax
   sort.sort-by-key
   UTIL_SortStreamsByValue
   UTIL_SortStreamsByKey
   UTIL_SortSwitchesByKey
 
  Other Library Functions
   sort.omsort-version
   sort.sort-by-key
   sort.sort-by-value
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:47 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.